public void Updateuserid() { if (Session["UserID"] != null) { if (Session["UserID"] != "") { using (cart obj = new cart()) { obj._userid = Convert.ToInt64(Session["UserID"].ToString()); obj._sessionid = Session["Current"].ToString(); obj._orderid = Convert.ToInt64("0"); obj.cart_updateuserid(); DataSet ds = new DataSet(); DataSet dsr = new DataSet(); ds = obj.cart_selectbyusoid(); dsr = obj.cart_selectbyuoid(); int i = dsr.Tables[0].Rows.Count; int j = ds.Tables[0].Rows.Count; if (i > j) { obj.cart_updatesessionid(); } } } } }
protected void Page_Load(object sender, EventArgs e) { lblMsg.Visible = false; if (Request.QueryString["flag"] == "login") { lblMsg.Text = "Login Successfully"; lblMsg.Visible = true; } if (Request.QueryString["flag"] == "signup") { lblMsg.Text = "Register Successfully"; lblMsg.Visible = true; } if (Request.QueryString["flag"] == "change") { lblMsg.Text = "Change Password Successfully"; lblMsg.Visible = true; } if (Request.QueryString["flag"] == "edit") { lblMsg.Text = "Update Successfully"; lblMsg.Visible = true; } if (Session["UserID"] == null) { Response.Redirect("Signin.aspx"); } else { using (cart obj = new cart()) { obj._orderid = Convert.ToInt64("0"); obj._userid = Convert.ToInt64(Session["UserID"].ToString()); DataSet ds = new DataSet(); lnkp.HRef += Session["UserID"].ToString(); lnkpp.HRef += Session["UserID"].ToString(); ds = obj.cart_selectbyuoid(); if (ds.Tables[0].Rows.Count > 0) { Session["current"] = ds.Tables[0].Rows[0]["SessionID"].ToString(); } else { Session["current"] = Session.SessionID.ToString(); } } } }