protected void Page_Load(object sender, EventArgs e) { PageConn pgcon = new PageConn(); con = pgcon.dynconn; pagetitleclass pg = new pagetitleclass(); string strData = Request.Url.ToString(); char[] separator = new char[] { '/' }; compid = Session["comid"].ToString(); string[] strSplitArr = strData.Split(separator); int i = Convert.ToInt32(strSplitArr.Length); string page = strSplitArr[i - 1].ToString(); Page.Title = pg.getPageTitle(page); if (!IsPostBack) { statuslable.Text = ""; Pagecontrol.dypcontrol(Page, page); //PageConn pgcon = new PageConn(); //con = pgcon.dynconn; statuslable.Visible = false; ViewState["sortOrder"] = ""; // ddl(); fillwarehouse(); // ModalPopupExtender1.Hide(); ModalPopupExtender1222.Hide(); FillGridView1(); } }
protected void Page_Load(object sender, EventArgs e) { PageConn pgcon = new PageConn(); con = pgcon.dynconn; if (Session["Comid"] == null) { Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx"); } compid = Session["comid"].ToString(); pagetitleclass pg = new pagetitleclass(); string strData = Request.Url.ToString(); char[] separator = new char[] { '/' }; string[] strSplitArr = strData.Split(separator); int i = Convert.ToInt32(strSplitArr.Length); string page = strSplitArr[i - 1].ToString(); compid = Session["Comid"].ToString(); Page.Title = pg.getPageTitle(page); ModalPopupExtender1222.Hide(); Label1.Visible = false; if (!IsPostBack) { Pagecontrol.dypcontrol(Page, page); ViewState["sortOrder"] = ""; //string strwh = "SELECT WareHouseId,Name,Address,CurrencyId FROM WareHouseMaster where comid='" + compid + "' and WareHouseMaster.Status='" + 1 + "'"; //SqlCommand cmdwh = new SqlCommand(strwh, con); //SqlDataAdapter adpwh = new SqlDataAdapter(cmdwh); //DataTable dtwh = new DataTable(); //adpwh.Fill(dtwh); //ddlWarehouse.DataSource = dtwh; //ddlWarehouse.DataTextField = "Name"; //ddlWarehouse.DataValueField = "WareHouseId"; //ddlWarehouse.DataBind(); //DropDownList1.DataSource = dtwh; //DropDownList1.DataTextField = "Name"; //DropDownList1.DataValueField = "WareHouseId"; //DropDownList1.DataBind(); //DropDownList1.Items.Insert(0, "ALL"); //DropDownList1.Items[0].Value = "0"; tXtEffectiveStartdate.Text = System.DateTime.Now.ToShortDateString(); txtenddate.Text = System.DateTime.Now.ToShortDateString(); fillstore(); fillstorewithfilter(); filldatagrid(); } }
protected void Button5_Click(object sender, EventArgs e) { ModalPopupExtender1222.Hide(); cleartext(); pnladd.Visible = false; lbladd.Text = ""; lblmsg.Text = ""; }
protected void Page_Load(object sender, EventArgs e) { if (Session["Comid"] == null) { Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx"); } PageConn pgcon = new PageConn(); con = pgcon.dynconn; pagetitleclass pg = new pagetitleclass(); string strData = Request.Url.ToString(); char[] separator = new char[] { '/' }; string[] strSplitArr = strData.Split(separator); int i = Convert.ToInt32(strSplitArr.Length); string page = strSplitArr[i - 1].ToString(); ViewState["Compid"] = Session["Comid"].ToString(); ViewState["UserName"] = Session["userid"].ToString(); Page.Title = pg.getPageTitle(page); if (!IsPostBack) { Pagecontrol.dypcontrol(Page, page); ViewState["sortOrder"] = ""; lblCompany.Text = Session["Cname"].ToString(); lblmsg.Text = ""; loadupdate(); fillgrid(); ModalPopupExtender1222.Hide(); } }
protected void ImageButton6_Click(object sender, EventArgs e) { ModalPopupExtender1222.Hide(); }
protected void ImageButton6_Click(object sender, ImageClickEventArgs e) { ModalPopupExtender1222.Hide(); Label1.Visible = false; }
protected void Button1_Click(object sender, EventArgs e) { fillgrid(); ModalPopupExtender1222.Hide(); }
protected void Button1_Click(object sender, EventArgs e) { int flag = 0; if (RadioButton1.Checked == true) { if (Convert.ToDecimal(txtSchemaValueDiscount.Text) > Convert.ToDecimal(100)) { flag = 1; } } if (flag == 0) { int discountflag = 0; if (txtMinValQuantity.Text != "" && txtMaxValQuantity.Text != "") { decimal MaxValue1 = Convert.ToDecimal(isdecimalornot(txtMaxValQuantity.Text)); decimal MinValue1 = Convert.ToDecimal(isdecimalornot(txtMinValQuantity.Text)); if (MinValue1 > MaxValue1) { discountflag = 1; } } if (discountflag == 0) { string str11 = "select Convert(nvarchar,StartDate,101) as StartDate,EndDate from [ReportPeriod] where Compid = '" + compid + "' and Active='1' and Whid='" + ddlWarehouse.SelectedValue + "'"; SqlCommand cmd11 = new SqlCommand(str11, con); SqlDataAdapter da = new SqlDataAdapter(cmd11); DataTable dt11 = new DataTable(); da.Fill(dt11); if (dt11.Rows.Count > 0) { if (Convert.ToDateTime(tXtEffectiveStartdate.Text) < Convert.ToDateTime(dt11.Rows[0][0].ToString())) { lblstartdate1.Text = dt11.Rows[0][0].ToString(); ModalPopupExtender1222.Show(); } else { int a, b; DateTime date = Convert.ToDateTime(System.DateTime.Now.ToShortDateString()); if (ddlstatus.SelectedIndex == 1) { a = 1; } else { a = 0; } if (RadioButton1.Checked == true) { b = 1; } else { b = 0; } decimal c1 = Convert.ToDecimal(isdecimalornot(txtMaxValQuantity.Text)); decimal b1 = Convert.ToDecimal(isdecimalornot(txtMinValQuantity.Text)); if (txtMaxValQuantity.Text == "") { c1 = b1 + 1; } //if (b1 > c1) //{ // Label1.Visible = true; // Label1.Text = "Minimum Quantity must be less than Maximum Quantity"; //} //else //{ DateTime dt = Convert.ToDateTime(tXtEffectiveStartdate.Text); DateTime dt1 = Convert.ToDateTime(txtenddate.Text); if (dt < Convert.ToDateTime(DateTime.Now.ToShortDateString())) { Label1.Visible = true; Label1.Text = "Start date must be the current date, or greater than the current date"; } else if (dt1 < dt) { Label1.Visible = true; Label1.Text = "End date must be the current date, or greater than the current date"; } else { try { string str111 = "Select * from OrderValueDiscountMaster where SchemeName='" + txtSchemaName.Text + "' and Whid='" + ddlWarehouse.SelectedValue + "'"; SqlCommand cmd111 = new SqlCommand(str111, con); SqlDataAdapter da1 = new SqlDataAdapter(cmd111); DataTable dt111 = new DataTable(); da1.Fill(dt111); if (dt111.Rows.Count == 0) { string strinsr = " INSERT INTO OrderValueDiscountMaster " + "(SchemeName,ValueDiscount,MinValue,MaxValue,StartDate,EndDate,Active,IsPercentage,ApplyOnlineSales,ApplyRetailSales,Whid) " + " VALUES ('" + txtSchemaName.Text + "','" + isdecimalornot(txtSchemaValueDiscount.Text) + "','" + isdecimalornot(txtMinValQuantity.Text) + "', " + " '" + txtMaxValQuantity.Text + "','" + tXtEffectiveStartdate.Text + "','" + txtenddate.Text + "', " + " '" + ddlstatus.SelectedValue + "', '" + b.ToString() + "','" + chkonline.Checked + "','" + chkretail.Checked + "','" + ddlWarehouse.SelectedValue + "') "; SqlCommand cmd = new SqlCommand(strinsr, con); if (con.State.ToString() != "Open") { con.Open(); } cmd.ExecuteNonQuery(); con.Close(); Label1.Visible = true; Label1.Text = "Record inserted successfully"; addinventoryroom.Visible = false; btnaddroom.Visible = true; clean(); filldatagrid(); ddlstatus.SelectedIndex = 0; } else { Label1.Visible = true; Label1.Text = "Record already exists "; } } catch (Exception ex) { Label1.Visible = true; Label1.Text = "Error"; } finally { } } } } } else { Label1.Visible = true; Label1.Text = "Minimum Order Value must be less than Maximum Order Value"; } } else { Label1.Visible = true; Label1.Text = "Order value discount percentage cannot be greater than 100%"; } }
protected void Imagee_Click(object sender, ImageClickEventArgs e) { ModalPopupExtender1222.Hide(); }
protected void Button1_Click(object sender, EventArgs e) { if (ViewState["Id"] != null) { string st1 = "select * from [WHTimeZone] Where WHTimeZone.WHID ='" + DropDownList1.SelectedValue + "'"; //and ID != '" + ViewState["Id"] + "' "; SqlCommand cmd = new SqlCommand(st1, con); SqlDataAdapter adp = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); adp.Fill(dt); if (dt.Rows.Count > 0) { //string st2 = "select * from Batchmaster Where batchmaster.BatchTimeZone ='" + dt.Rows[0]["ID"].ToString() + "'"; //SqlCommand cmd2 = new SqlCommand(st2, con); //SqlDataAdapter adp2 = new SqlDataAdapter(cmd2); //DataTable dt2 = new DataTable(); //adp2.Fill(dt2); //if (dt2.Rows.Count > 0) //{ // lblmsg.Text = "Sorry,you can't set another Time Zone"; // return; //} //else //{ string str1 = "Update WHTimeZone SET WHID='" + DropDownList1.SelectedValue + "', TimeZone='" + DropDownList2.SelectedValue + "' WHERE ID=" + ViewState["Id"] + ""; SqlCommand cmd1 = new SqlCommand(str1, con); if (con.State.ToString() != "Open") { con.Open(); } cmd1.ExecuteNonQuery(); con.Close(); //SqlDataAdapter adp1 = new SqlDataAdapter(cmd1); //DataTable dt1 = new DataTable(); //adp1.Fill(dt1); fillgrid(); cleartext(); lblmsg.Text = "Record updated successfully"; //ImageButton2.Visible = true; //Button1.Visible = false; pnladd.Visible = false; lbladd.Text = ""; ModalPopupExtender1222.Hide(); //} } } else { string str1 = "Update WHTimeZone SET WHID='" + DropDownList1.SelectedValue + "', TimeZone='" + DropDownList2.SelectedValue + "' WHERE ID=" + Convert.ToInt16(Session["ID1"]) + ""; SqlCommand cmd1 = new SqlCommand(str1, con); if (con.State.ToString() != "Open") { con.Open(); } cmd1.ExecuteNonQuery(); con.Close(); //SqlDataAdapter adp1 = new SqlDataAdapter(cmd1); //DataTable dt1 = new DataTable(); //adp1.Fill(dt1); fillgrid(); cleartext(); lblmsg.Text = "Record updated successfully"; ModalPopupExtender1222.Hide(); //ImageButton2.Visible = true; //Button1.Visible = false; pnladd.Visible = false; lbladd.Text = ""; } // Label masterkey = (Label) GridView1.FindControl("lbbname"); }