void Factor_Payment_Update() { Shoping ac = new Shoping(); ShopingDatum dm = new ShopingDatum(); dm.Id_Factor = decimal.Parse(Request.QueryString["Id_Factor"]); if (RadioButton1.Checked) { dm.Peyment_Kind = "پرداخت اینترنتی"; } if (RadioButton2.Checked) { dm.Peyment_Kind = "واريز به حساب"; } dm.Bank_Name = DropDownList1.SelectedItem.Text; dm.Peyment_Code = TextBox1.Text; dm.Bank_Code = TextBox9.Text; dm.Peyment_Date = TextBox2.Text; dm.Peyment_Price = decimal.Parse(TextBox3.Text); dm.Customer_Name = TextBox4.Text; dm.Customer_Tell = TextBox5.Text; dm.Customer_Time_Recive = TextBox6.Text; dm.Customer_Address = TextBox7.Text; dm.Description = TextBox8.Text; ac.Update_Peyment_Factor(dm); Label20.Visible = true; Label20.Text = "اطلاعات به روز شد"; }
//<بررسی می کند که این فاکتور با این کوئری استریگ درست می باشد> void check_factor() { Shoping ac = new Shoping(); ShopingDatum dm = new ShopingDatum(); if (Request.QueryString["Id_User"] != null && Request.QueryString["Id_Factor"] != null && Request.QueryString["Factor_Code"] != null) { dm.Id_User = decimal.Parse(Request.QueryString["Id_User"].ToString()); dm.Factor_Code = Request.QueryString["Factor_Code"].ToString(); dm.Id_Factor = decimal.Parse(Request.QueryString["Id_Factor"].ToString()); if (ac.check_factor(dm)) { fill_factor(); } else { Response.Redirect("~/index.aspx?Type=404"); } } else { Response.Redirect("~/index.aspx?Type=404"); } }
private void Fill() { OneRecord aco = new OneRecord(); OneRecordDatum dmo = new OneRecordDatum(); DataTable dt; dmo.Type = "AddressPrint"; dt = aco.SelectOne(dmo); if (dt.Rows.Count > 0) { Label1.Text = dt.Rows[0]["text"].ToString(); } BLL.user blu = new user(); Shoping ac = new Shoping(); ShopingDatum dm = new ShopingDatum(); string company, post_code; dm.Id_Factor = decimal.Parse(Request.QueryString["Id_Factor"].ToString()); DataTable dt2 = ac.select_factor_one(dm); DataTable dtuser = blu.select_one_user(new userDatum() { Id = int.Parse(dt2.Rows[0]["id_user"].ToString()) }); company = dtuser.Rows[0]["company"].ToString(); post_code = dtuser.Rows[0]["post_code"].ToString(); Label1.Text = Label1.Text.Replace("NameUser", dt2.Rows[0]["customer_name"].ToString()); Label1.Text = Label1.Text.Replace("TellphoneUser", dt2.Rows[0]["customer_tell"].ToString()); Label1.Text = Label1.Text.Replace("AddressUser", string.Format(" {0} <br/> کد پستی {1} <br/> نام شرکت {2}", dt2.Rows[0]["customer_address"].ToString(), company, post_code)); }
//-----------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------// void fill_factor() { Shoping ac = new Shoping(); ShopingDatum dm = new ShopingDatum(); dm.Id_User = decimal.Parse(Request.Cookies["Id_User"].Value); if (Request.QueryString["Kind"] == "NoPayment") { GridView1.DataSource = ac.select_factor_nopeyment(dm); } else if (Request.QueryString["Kind"] == "Payment") { GridView1.DataSource = ac.select_factor_peyment(dm); } else if (Request.QueryString["Kind"] == "Sended") { GridView1.DataSource = ac.select_factor_sended(dm); } else if (Request.QueryString["Kind"] == "All") { GridView1.DataSource = ac.select_factor_all_User(dm); } else { GridView1.DataSource = ac.select_factor_all_User(dm); } GridView1.DataBind(); }
void factor_peyment_register() { Shoping ac = new Shoping(); ShopingDatum dm = new ShopingDatum(); dm.Id_Factor = decimal.Parse(Request.QueryString["Id_Factor"]); if (RadioButton1.Checked) { dm.Peyment_Kind = "پرداخت اینترنتی"; } if (RadioButton2.Checked) { dm.Peyment_Kind = "واريز به حساب"; } dm.Bank_Name = DropDownList1.SelectedItem.Text; dm.Peyment_Code = TextBox1.Text; dm.Bank_Code = TextBox9.Text; dm.Peyment_Date = TextBox2.Text; dm.Peyment_Price = decimal.Parse(TextBox3.Text); dm.Customer_Name = TextBox4.Text; dm.Customer_Tell = TextBox5.Text; dm.Customer_Time_Recive = TextBox6.Text; dm.Customer_Address = TextBox7.Text; dm.Description = TextBox8.Text; ac.Update_Peyment_Factor(dm); factor_condition_update(); Response.Redirect("~/index.aspx?Type=ShopPeymentEnd&Factor_Code=" + Label37.Text + "&Id_Factor=" + Label34.Text + "&Sum_Price=" + Label55.Text); }
//<اطلاعات فاکتور را نمايش مي دهد> void fill_factor() { Shoping ac = new Shoping(); ShopingDatum dm = new ShopingDatum(); DataSet ds = new DataSet(); decimal Sum_Price; decimal All_Sum_Price = 0; if (Request.QueryString["Id_Factor"] != null && Request.QueryString["Id_Factor"].Length > 0) { dm.Id_Factor = decimal.Parse(Request.QueryString["Id_Factor"].ToString()); GridView1.DataSource = ac.select_factor_detail(dm); GridView1.DataBind(); DataTable dt = ac.select_factor_one(dm); Label10.Text = dt.Rows[0]["date_register"].ToString(); Label11.Text = dt.Rows[0]["id"].ToString(); Label20.Text = dt.Rows[0]["factor_code"].ToString(); Label32.Text = BLL.PublicClass.numberToMoney(dt.Rows[0]["sum_price"].ToString()); Label31.Text = BLL.PublicClass.numberToMoney(dt.Rows[0]["send_price"].ToString()); Label34.Text = BLL.PublicClass.numberToMoney(dt.Rows[0]["tasx"].ToString()); if (Label34.Text.Trim() == "0") { Label33.Visible = false; Label34.Visible = false; Image3.Visible = false; } Label44.Text = BLL.PublicClass.numberToMoney(dt.Rows[0]["discount"].ToString()); if (Label44.Text.Trim() == "0") { Label43.Visible = false; Label44.Visible = false; Image5.Visible = false; } for (int i = 0; i < GridView1.Rows.Count; i++) { Sum_Price = decimal.Parse(((Label)(GridView1.Rows[i].FindControl("Label24"))).Text); All_Sum_Price = All_Sum_Price + Sum_Price; } Label36.Text = BLL.PublicClass.numberToMoney(All_Sum_Price.ToString()); //Label47.Text = ds.Tables[0].Rows[0]["bank_name"].ToString(); //Label42.Text = ds.Tables[0].Rows[0]["peyment_code"].ToString(); //Label49.Text = ds.Tables[0].Rows[0]["bank_code"].ToString(); //Label51.Text = ds.Tables[0].Rows[0]["peyment_date"].ToString(); //Label53.Text = ds.Tables[0].Rows[0]["peyment_price"].ToString(); //Label56.Text = ds.Tables[0].Rows[0]["customer_name"].ToString(); //Label62.Text = ds.Tables[0].Rows[0]["customer_time_recive"].ToString(); //Label66.Text = ds.Tables[0].Rows[0]["description"].ToString(); lbDescription.Text = dt.Rows[0]["description"].ToString(); } }
void factor_condition_update2() { Shoping ac = new Shoping(); ShopingDatum dm = new ShopingDatum(); PublicClass pc = new PublicClass(); dm.Id_Factor = decimal.Parse(Request.QueryString["Id_Factor"]); dm.Factor_Condition = "در تاریخ " + pc.GetDate() + " سفارش ارسال شد"; ac.Update_Factor_Condition(dm); }
void factor_condition_update() { Shoping ac = new Shoping(); ShopingDatum dm = new ShopingDatum(); PublicClass pc = new PublicClass(); if (Request.QueryString["Id_Factor"] != null) { dm.Id_Factor = decimal.Parse(Request.QueryString["Id_Factor"]); } dm.Factor_Condition = "در تاریخ " + pc.GetDate() + " مبلغ واریز شد"; ac.Update_Factor_Condition(dm); }
//<اطلاعات کاربر را نشان مي دهد> void fill_user_work() { Shoping ac2 = new Shoping(); ShopingDatum dm2 = new ShopingDatum(); DataSet ds = new DataSet(); dm2.Register_Date = ""; dm2.Id_User = decimal.Parse(Request.Cookies["ID_User"].Value); Label38.Text = "مشاهده ( " + ac2.select_factor_nopeyment(dm2).Rows.Count.ToString() + " )"; Label4.Text = "مشاهده ( " + ac2.select_factor_peyment(dm2).Rows.Count.ToString() + " )"; Label40.Text = "مشاهده ( " + ac2.select_factor_sended(dm2).Rows.Count.ToString() + " )"; }
void fill_factor() { Shoping ac = new Shoping(); ShopingDatum dm = new ShopingDatum(); DataSet ds = new DataSet(); decimal Sum_Price; decimal All_Sum_Price = 0; dm.Id_Factor = decimal.Parse(Request.QueryString["Id_Factor"].ToString()); GridView1.DataSource = ac.select_factor_detail(dm); GridView1.DataBind(); DataTable dt = ac.select_factor_one(dm); Label38.Text = Request.QueryString["Id_Factor"].ToString(); Label22.Text = BLL.PublicClass.numberToMoney(dt.Rows[0]["sum_price"].ToString()); Label19.Text = BLL.PublicClass.numberToMoney(dt.Rows[0]["send_price"].ToString()); Label33.Text = BLL.PublicClass.numberToMoney(dt.Rows[0]["tasx"].ToString()); if (Label33.Text == "0") { lblTasx.Visible = false; } Label40.Text = dt.Rows[0]["factor_condition"].ToString(); Label2.Text = dt.Rows[0]["date_register"].ToString(); Label4.Text = dt.Rows[0]["peyment_date"].ToString(); Label12.Text = BLL.PublicClass.numberToMoney(dt.Rows[0]["discount"].ToString()); if (Label12.Text == "0") { DivTakhfif.Visible = false; } if (Label4.Text.Length == 0) { PayDiv.Visible = false; } Label7.Text = dt.Rows[0]["date_send"].ToString(); if (Label7.Text.Length == 0) { SendDiv.Visible = false; } for (int i = 0; i < GridView1.Rows.Count; i++) { Sum_Price = decimal.Parse(((Label)(GridView1.Rows[i].FindControl("Label14"))).Text); All_Sum_Price = All_Sum_Price + Sum_Price; } Label15.Text = BLL.PublicClass.numberToMoney(All_Sum_Price.ToString()); }
//<اطلاعات فيش واريزي را نشان دهد> void fill_peyment() { Shoping ac = new Shoping(); ShopingDatum dm = new ShopingDatum(); DataSet ds = new DataSet(); if (Request.QueryString["Id_Factor"] != null && Request.QueryString["Factor_Code"] != null && Request.Cookies["Id_User"] != null) { dm.Id_Factor = decimal.Parse(Request.QueryString["Id_Factor"]); dm.Factor_Code = Request.QueryString["Factor_Code"]; dm.Id_User = decimal.Parse(Request.Cookies["Id_User"].Value); } DataTable dt = ac.select_factor_one(dm); if (dt.Rows.Count > 0) { TextBox1.Text = dt.Rows[0]["peyment_code"].ToString(); TextBox9.Text = dt.Rows[0]["bank_code"].ToString(); TextBox2.Text = dt.Rows[0]["peyment_date"].ToString(); TextBox3.Text = dt.Rows[0]["peyment_price"].ToString(); TextBox4.Text = dt.Rows[0]["customer_name"].ToString(); TextBox5.Text = dt.Rows[0]["customer_tell"].ToString(); TextBox6.Text = dt.Rows[0]["customer_time_recive"].ToString(); TextBox7.Text = dt.Rows[0]["customer_address"].ToString(); TextBox8.Text = dt.Rows[0]["description"].ToString(); if (dt.Rows[0]["peyment_kind"].ToString() == "واريز به حساب") { RadioButton2.Checked = true; RadioButton1.Checked = false; } else { RadioButton2.Checked = false; RadioButton1.Checked = true; } if (dt.Rows[0]["bank_name"].ToString().Length > 0) { DropDownList1.Items.FindByText(dt.Rows[0]["bank_name"].ToString()).Selected = true; } if (TextBox2.Text.Length == 0) { fill_user(); PublicClass p = new PublicClass(); TextBox2.Text = p.GetDate(); } } }
protected void Button3_Click(object sender, EventArgs e) { Shoping ac = new Shoping(); ShopingDatum dm = new ShopingDatum(); PublicClass pc = new PublicClass(); dm.Id_Factor = decimal.Parse(Request.QueryString["Id_Factor"].ToString()); dm.Date_Agreement_Factor = pc.GetDate(); dm.Factor_Agreement = "False"; dm.Factor_Condition = " در تاریخ " + pc.GetDate() + " سفارش لغو شد"; ac.Update_Factor_Agreement(dm); Label20.Visible = true; Label20.Text = "سفارش لغو شد"; }
protected void Button4_Click(object sender, EventArgs e) { Shoping ac = new Shoping(); ShopingDatum dm = new ShopingDatum(); Calcuate(); dm.Id_Factor = decimal.Parse(Request.QueryString["Id_Factor"].ToString()); dm.Discount = decimal.Parse(TextBoxTakhfif.Text); dm.Tasx = decimal.Parse(TextBox10.Text); dm.Send_Price = decimal.Parse(TextBox11.Text); dm.Sum_Price = decimal.Parse(Label22.Text); dm.Description = txtDescription.Text; ac.Factor_Update_Takhfif(dm); Label19.Visible = true; }
protected void Button2_Click(object sender, EventArgs e) { Factor_Payment_Update(); Shoping ac = new Shoping(); ShopingDatum dm = new ShopingDatum(); PublicClass pc = new PublicClass(); dm.Id_Factor = decimal.Parse(Request.QueryString["Id_Factor"].ToString()); dm.Date_Send = pc.GetDate(); dm.Send_Product = true; dm.Factor_Condition = " در تاریخ " + pc.GetDate() + " سفارش ارسال شد"; ac.Update_Send_Factor(dm); Label20.Visible = true; Label20.Text = "ارسال سفارش تایید شد"; factor_condition_update2(); }
//<بررسی می کند که این فاکتور با این کوئری استریگ درست می باشد> void check_factor() { Shoping ac = new Shoping(); ShopingDatum dm = new ShopingDatum(); if (Request.QueryString["Id_User"] != null && Request.QueryString["Id_Factor"] != null && Request.QueryString["Factor_Code"] != null) { dm.Id_User = decimal.Parse(Request.QueryString["Id_User"].ToString()); dm.Id_Factor = decimal.Parse(Request.QueryString["Id_Factor"].ToString()); dm.Factor_Code = Request.QueryString["Factor_Code"].ToString(); if (ac.check_factor(dm)) { fill_factor(); fill_user(); } } }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowIndex != -1) { string id = ((Label)(e.Row.FindControl("Lblid"))).Text; Shoping ac2 = new Shoping(); ShopingDatum dm2 = new ShopingDatum(); Support_Comment ac3 = new Support_Comment(); Support_CommentDatum dm3 = new Support_CommentDatum(); dm3.ID_User = decimal.Parse(id); dm3.SendType = "User"; dm2.Register_Date = ""; dm2.Id_User = decimal.Parse(id); int n = ac2.select_factor_nopeyment(dm2).Rows.Count; int p = ac2.select_factor_peyment(dm2).Rows.Count; int s = ac2.select_factor_sended(dm2).Rows.Count; int sp = ac3.Select(dm3).Rows.Count; if (n > 0) { ((HyperLink)(e.Row.FindControl("HyperLinkn"))).Text = "مشاهده ( " + n.ToString() + " )"; } if (p > 0) { ((HyperLink)(e.Row.FindControl("HyperLinkp"))).Text = "مشاهده ( " + p.ToString() + " )"; } if (s > 0) { ((HyperLink)(e.Row.FindControl("HyperLinks"))).Text = "مشاهده ( " + s.ToString() + " )"; } if (sp > 0) { ((HyperLink)(e.Row.FindControl("HyperLinksp"))).Text = "مشاهده ( " + sp.ToString() + " )"; } } }
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)); } }
void fill_factor() { int userid; Shoping ac = new Shoping(); ShopingDatum dm = new ShopingDatum(); DataSet ds = new DataSet(); decimal Sum_Price; decimal All_Sum_Price = 0; dm.Id_Factor = decimal.Parse(Request.QueryString["Id_Factor"].ToString()); GridView1.DataSource = ac.select_factor_detail(dm); GridView1.DataBind(); DataTable dt = ac.select_factor_one(dm); userid = int.Parse(dt.Rows[0]["id_user"].ToString()); Label38.Text = Request.QueryString["Id_Factor"].ToString(); Label22.Text = BLL.PublicClass.numberToMoney(dt.Rows[0]["sum_price"].ToString()); TextBox11.Text = dt.Rows[0]["send_price"].ToString(); TextBox10.Text = dt.Rows[0]["tasx"].ToString(); TextBoxTakhfif.Text = dt.Rows[0]["Discount"].ToString(); Label40.Text = dt.Rows[0]["factor_condition"].ToString(); Label2.Text = dt.Rows[0]["date_register"].ToString(); Label4.Text = dt.Rows[0]["peyment_date"].ToString(); txtDescription.Text = dt.Rows[0]["description"].ToString(); for (int i = 0; i < GridView1.Rows.Count; i++) { Sum_Price = decimal.Parse(((Label)(GridView1.Rows[i].FindControl("Label14"))).Text); All_Sum_Price = All_Sum_Price + Sum_Price; } Label15.Text = BLL.PublicClass.numberToMoney(All_Sum_Price.ToString()); TextBox1.Text = dt.Rows[0]["peyment_code"].ToString(); TextBox9.Text = dt.Rows[0]["bank_code"].ToString(); TextBox2.Text = dt.Rows[0]["peyment_date"].ToString(); TextBox3.Text = dt.Rows[0]["peyment_price"].ToString(); TextBox4.Text = dt.Rows[0]["customer_name"].ToString(); TextBox5.Text = dt.Rows[0]["customer_tell"].ToString(); TextBox6.Text = dt.Rows[0]["customer_time_recive"].ToString(); TextBox7.Text = dt.Rows[0]["customer_address"].ToString(); TextBox8.Text = dt.Rows[0]["description"].ToString(); if (dt.Rows[0]["peyment_kind"].ToString() == "واريز به حساب") { RadioButton2.Checked = true; RadioButton1.Checked = false; } else { RadioButton2.Checked = false; RadioButton1.Checked = true; } if (dt.Rows[0]["bank_name"].ToString().Length > 0) { DropDownList1.Items.FindByText(dt.Rows[0]["bank_name"].ToString()).Selected = true; } if (Label4.Text.Length == 0) { Label4.Text = "هنوز ثبت نشده است"; FillUser(decimal.Parse(dt.Rows[0]["ID_User"].ToString())); } Label7.Text = dt.Rows[0]["date_send"].ToString(); if (Label7.Text.Length == 0) { Label7.Text = "هنوز ارسال نشده است"; } TextBox12.Text = new BLL.user().select_one_user(new userDatum() { Id = userid }).Rows[0]["post_code"].ToString(); }