protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { if (Session["ZOYALUSER"] != null) { lbllogin.Visible = false; myaccount.Visible = true; } // clearcontrols(); cart_visible(); //loading locations cities da = new cities(); DataTable dt_price = (DataTable)Session["CART"]; DataTable dt_loc = BLL.GETCITIES(da); Session["CITY_ID"] = dt_loc.ToString(); string locations = ""; for (int i = 0; i < dt_loc.Rows.Count; i++) { locations = locations + "<li ><a href='http://localhost:50847/index.aspx?city_id=" + dt_loc.Rows[i]["CITY_ID"] + "'>" + dt_loc.Rows[i]["CITY_NAME"].ToString() + "</a></li>"; } ul_locations.InnerHtml = locations; // object GRAND_TOTAL = dt_price.Compute("Sum(PRODUCT_SUB_TOTAL)", string.Empty); sub_amount_cart.InnerHtml = dt_price.Compute("Sum(PRODUCT_SUB_TOTAL)", string.Empty).ToString(); } catch (Exception exe) { } if (Request.QueryString["id"] != null) { string productid = Request.QueryString["id"].ToString(); DataTable dt_productcart = BLL.GETPRODUCTBYID(productid); if (Session["CART"] != null) { DataTable dt_productall = (DataTable)Session["CART"]; string html = parsehtmlcart(dt_productall); CART_BAG.InnerHtml = html; } else { } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { if (Request.QueryString["id"] != null) { string productid = Request.QueryString["id"].ToString(); DataTable dt_product = BLL.GETPRODUCTBYID(productid); dt_product.Columns.Add("PRODUCT_QTY", typeof(System.Int32)); dt_product.Columns.Add("PRODUCT_SUB_TOTAL", typeof(System.Decimal)); dt_product.Columns.Add("GRAND_TOTAL", typeof(System.Decimal)); DataRow[] result1 = dt_product.Select("product_id = " + productid + ""); foreach (DataRow row in result1) { if (row["PRODUCT_ID"].ToString().Equals("" + productid + "")) { row["PRODUCT_QTY"] = 1; row["PRODUCT_SUB_TOTAL"] = row["PRODUCT_PRICE"]; } } if (Session["CART"] == null) { Session["CART"] = dt_product; } else { DataTable dt_temp = (DataTable)Session["CART"]; bool sta = false; for (int i = 0; i < dt_temp.Rows.Count; i++) { if (dt_temp.Rows[i]["PRODUCT_ID"].ToString() == Request.QueryString["id"]) { sta = true; } } if (sta == false) { DataTable dt_allpro = (DataTable)Session["CART"]; dt_product.Merge(dt_allpro); // dt_allpro.Merge(dt_product); Session["CART"] = dt_product; } } } if (Session["CART"] != null) { DataTable dt_productall = (DataTable)Session["CART"]; string html = parsehtmlcart(dt_productall); tb_cart.InnerHtml = html; } else { } cities da = new cities(); DataTable dt_loc1 = BLL.GETCITIES(da); string selectcity = "<select onchange='dropcity(this);' class=\"formDropdown\" data-style=\"btn-success\">"; for (int i = 0; i < dt_loc1.Rows.Count; i++) { selectcity = selectcity + "<option value='" + dt_loc1.Rows[i]["city_id"] + "' >" + dt_loc1.Rows[i]["CITY_NAME"].ToString() + "</option>"; } try { select_city.InnerHtml = selectcity + "</select>"; } catch (Exception ex) { } } catch (Exception exe) { } // clearcontrol(); // string startdate =""; // string enddate = ""; DataTable dt_details = (DataTable)Session["DETAILS"]; if (Session["DETAILS"] != null) { txt_name.Text = dt_details.Rows[0]["FRIST_NAME"].ToString(); txt_email.Text = dt_details.Rows[0]["EMAIL_ID"].ToString(); txt_phonenumber.Text = dt_details.Rows[0]["PRIMARYPHONE"].ToString(); txt_altphonenumber.Text = dt_details.Rows[0]["ALTPHONE"].ToString(); txt_addline1.Text = dt_details.Rows[0]["ADDRESS1"].ToString(); txt_addline2.Text = dt_details.Rows[0]["ADDRESS2"].ToString(); txt_promocode.Text = dt_details.Rows[0]["PROMOCODE"].ToString(); txt_audience.Text = dt_details.Rows[0]["AUDIENCE"].ToString(); // startdate = dt_details.Rows[0]["STARTDATE"].ToString(); // enddate = dt_details.Rows[0]["ENDDATE"].ToString(); // startdate = DateTime.Now.ToString("dd/MM/yyyy "); //enddate= DateTime.Now.ToString("dd/MM/yyyy "); txt_startdate.Text = dt_details.Rows[0]["STARTDATE"].ToString(); txt_enddate.Text = dt_details.Rows[0]["ENDDATE"].ToString(); } } }
//internal static DataTable Getlocations() //{ // DataTable DT = BLL.ExecuteQuery("EXEC USP_GETTINGLOCATIONS @OPERATION='GETLOCATIONS'"); // return DT; //} internal static DataTable GETCITIES(cities obj) { DataTable DT = BLL.ExecuteQuery("EXEC USP_CITIES @OPERATION='GETCITIES'"); return DT; }
protected void btn_conshaping_Click(object sender, EventArgs e) { try { cities da = new cities(); //DataTable dt_loc = (DataTable)Session["CITY_ID"]; //DataTable dt_loc1 = BLL.GETCITIES(da); Response.Redirect("index.aspx"); } catch (Exception ex) { } }