payment

Download Payment

If you can't read please download the document

Upload: kamal-tiwari

Post on 14-Feb-2016

213 views

Category:

Documents


0 download

DESCRIPTION

PAYMENT

TRANSCRIPT

using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Data.SqlClient;using System.Configuration;public partial class ViewCart : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["dbcon"].ConnectionString); con.Open(); string qry = "select Prodid,Price,Qty from tempcart where Custid=@t1"; SqlCommand cmd = new SqlCommand(qry, con); cmd.Parameters.AddWithValue("@t1", Session["cid"].ToString()); SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { GridView1.DataSource = dr; GridView1.DataBind(); } dr.Close(); string qry1 = "select sum(Price) from tempcart where Custid=@t1"; SqlCommand cmd1 = new SqlCommand(qry1, con); cmd1.Parameters.AddWithValue("@t1", Session["cid"].ToString()); SqlDataReader dr1 = cmd1.ExecuteReader(); dr1.Read(); Label1.Text = dr1[0].ToString(); Session["total"] = dr1[0].ToString(); } protected void Button1_Click(object sender, EventArgs e) { Response.Redirect("PaybyCard.aspx"); }}