protected void Button1_Click(object sender, EventArgs e) { user ac = new user(); userDatum dm = new userDatum(); dm.Email = TextTitle.Text; dm.Pass = TextBox1.Text; DataTable dt = ac.Check_Login(dm); if (dt.Rows.Count > 0) { Response.Cookies.Add(new HttpCookie("Family_User", dt.Rows[0]["name"].ToString() + " " + dt.Rows[0]["family"].ToString())); Response.Cookies.Add(new HttpCookie("Email_User", TextTitle.Text)); Response.Cookies.Add(new HttpCookie("Id_User", dt.Rows[0]["id"].ToString())); Response.Cookies.Add(new HttpCookie("Login_User", "True")); Label30.Visible = false; Label1.Visible = true; Login1.Visible = false; ImageButton5.Visible = true; if (GridView1.Rows.Count <= 0) { ImageButton5.Visible = false; Label1.Visible = false; Image6.Visible = false; } } else { } }
private void FillUser(decimal ID_User) { user ac = new user(); userDatum dm = new userDatum(); dm.Id = ID_User; DataTable dt = ac.select_one_user(dm); TextBox4.Text = dt.Rows[0]["name"].ToString() + " " + dt.Rows[0]["family"].ToString(); TextBox5.Text = dt.Rows[0]["tell"].ToString() + " - " + dt.Rows[0]["mobile"].ToString(); TextBox7.Text = dt.Rows[0]["address"].ToString(); }
void fill_user() { user ac = new user(); userDatum dm = new userDatum(); dm.Id = decimal.Parse(Request.Cookies["Id_User"].Value); DataTable dt = ac.select_one_user(dm); TextBox4.Text = dt.Rows[0]["name"].ToString() + " " + dt.Rows[0]["family"].ToString(); TextBox5.Text = dt.Rows[0]["tell"].ToString() + " - " + dt.Rows[0]["mobile"].ToString(); TextBox7.Text = dt.Rows[0]["address"].ToString(); }
//<اطلاعات کاربر را نمايش مي دهد> void fill_user() { user ac = new user(); userDatum dm = new userDatum(); DataSet ds = new DataSet(); if (Request.QueryString["Id_User"] != null && Request.QueryString["Id_User"].Length > 0) { dm.Id = decimal.Parse(Request.QueryString["Id_User"].ToString()); DataTable dt = ac.select_one_user(dm); Label16.Text = dt.Rows[0]["company"].ToString(); Label19.Text = dt.Rows[0]["email"].ToString(); Label17.Text = dt.Rows[0]["address"].ToString(); Label18.Text = dt.Rows[0]["tell"].ToString(); } }
protected void btnClean_Click(object sender, EventArgs e) { TextBox1.Text = ""; TextBox2.Text = ""; TextBox3.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; TextBox7.Text = ""; TextBox8.Text = ""; TextBox9.Text = "ایران"; TextBox10.Text = ""; TextBox11.Text = ""; TextBox12.Text = ""; DropDownList1.SelectedIndex = 0; DropDownList2.SelectedIndex = 0; CheckBox1.Checked = false; dm = new userDatum(); }
protected void ImageButton5_Click(object sender, ImageClickEventArgs e) { decimal id_user; string user_name; if (Request.Cookies["Login_User"] == null) { Label30.Visible = true; Login1.Visible = true; TextTitle.Focus(); } else { Label30.Visible = false; id_user = decimal.Parse(Request.Cookies["Id_User"].Value); user_name = Request.Cookies["Family_User"].Value; user ac = new user(); userDatum dm = new userDatum(); dm.Id = id_user; DataTable dt = ac.select_one_user(dm); user_name = dt.Rows[0]["name"].ToString() + " " + dt.Rows[0]["family"].ToString(); //-----------------------------------------------------------------------------------------------// Shoping ac2 = new Shoping(); ShopingDatum dm2 = new ShopingDatum(); PublicClass pc = new PublicClass(); dm2.Id_User = id_user; dm2.Register_Date = pc.GetDate(); Random rnd = new Random(); string f_code = null; for (int j = 0; j < 16; j++) { f_code = f_code + rnd.Next(0, 9).ToString(); } dm2.Factor_Code = f_code; dm2.Tasx = decimal.Parse(Label33.Text); dm2.Send_Price = decimal.Parse(Label19.Text); dm2.Sum_Price = decimal.Parse(Label22.Text); dm2.Factor_Condition = "در تاریخ " + pc.GetDate() + " سفارش ثبت شد"; dm2.Customer_Name = user_name; decimal id_factor = ac2.Insert_Factor(dm2); dm2.Id_Factor = id_factor; for (int i = 0; i < GridView1.Rows.Count; i++) { dm2.Count = int.Parse(((DropDownList)(GridView1.Rows[i].FindControl("DropDownList1"))).SelectedValue); dm2.Id_Product = decimal.Parse(((Label)(GridView1.Rows[i].FindControl("lblid"))).Text); ac2.Insert_Factor_Details(dm2); update_number_shop(decimal.Parse(((Label)(GridView1.Rows[i].FindControl("lblid"))).Text), int.Parse(((DropDownList)(GridView1.Rows[i].FindControl("DropDownList1"))).SelectedValue)); } Session["ProductTable"] = null; Response.Redirect("~/index.aspx?Type=ShopPeymentRegister&Factor_Code=" + f_code + "&Id_Factor=" + id_factor + "&Sum_Price=" + decimal.Parse(Label22.Text)); } }