protected void Page_Load(object sender, EventArgs e) { databaseaccesslayer dataobj = new databaseaccesslayer(); if (!IsPostBack) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=56 and IsVaild=1"; DataTable dt1 = dataobj.Selectdatatable(sql1); if (dt1.Rows.Count == 1) { string sql = @"select * from CustomerAndSupplier where Supplier=1"; string path = "Reports/ReportSupplier.rpt"; string sqls = sql; System.Drawing.Printing.PrintDocument printDocument = new System.Drawing.Printing.PrintDocument(); ReportDocument reportdocument = new ReportDocument(); reportdocument.Load(Server.MapPath(path)); reportdocument.DataSourceConnections[0].SetConnection(".", "ERPsystem", true); reportdocument.SetDataSource(dataobj.Selectdatatable(sqls)); reportdocument.SetParameterValue("@Type", true); CrystalReportViewer1.ReportSource = reportdocument; } else { Response.Redirect("MainPage.aspx"); } } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string sql = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=28 and IsVaild=1"; DataTable dt = databaseaccesslayerobj.Selectdatatable(sql); if (dt.Rows.Count == 1) { addValidationGroup(); generateguid(); drpType.Items.Insert(0, "اختار"); drpType.Items.Insert(1, "عملاء"); drpType.Items.Insert(2, "موردين"); for (int i = 1; i < 13; i++) { drpMonth.Items.Add(i.ToString()); } for (int i = 1; i < 31; i++) { drpDay.Items.Add(i.ToString()); } } else { Response.Redirect("MainPage.aspx"); } } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=17 and IsVaild=1"; DataTable dt1 = dataObj.Selectdatatable(sql1); if (dt1.Rows.Count != 1) { Response.Redirect("MainPage.aspx"); } addValidationGroup(); drpIssueNumber.DataSource = dataObj.Selectdatatable("select Id,IssueNumber from Ta_Issue where IssaueStatus=1"); drpIssueNumber.DataTextField = "IssueNumber"; drpIssueNumber.DataValueField = "Id"; drpIssueNumber.DataBind(); drpIssueNumber.Items.Insert(0, "أختار رقم القضية"); } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=8 and IsVaild=1"; DataTable dt1 = dataobj.Selectdatatable(sql1); if (dt1.Rows.Count != 1) { Response.Redirect("MainPage.aspx"); } ddlEmployee.DataSource = dataobj.Selectdatatable("select * from Ta_Employee order by Id desc"); ddlEmployee.DataTextField = "EmployeeName"; ddlEmployee.DataValueField = "Id"; ddlEmployee.DataBind(); ddlEmployee.Items.Insert(0, "Select Employee"); ddlEmployee.SelectedIndex = 0; } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string sql = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=9 and IsVaild=1"; DataTable dt = DataObj.Selectdatatable(sql); if (dt.Rows.Count == 1) { string sql1 = @"select Name as الاسم,(select (OldAmountCome+(select sum(Amount) from TransactionOfTreasure where Amount>0)) from MainTreasure ) as الايرادات,(select (OldAmountOut+(select (-1*sum(Amount)) from TransactionOfTreasure where Amount<0)) from MainTreasure) as المصروفات,(select (Amount+(select (sum(Amount)) from TransactionOfTreasure)) from MainTreasure ) as المبلغ from MainTreasure "; grdSelect.DataSource = DataObj.Selectdatatable(sql1); grdSelect.DataBind(); } else { Response.Redirect("MainPage.aspx"); } } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=34 and IsVaild=1"; DataTable dt1 = dataObj.Selectdatatable(sql1); if (dt1.Rows.Count != 1) { Response.Redirect("MainPage.aspx"); } addValidationGroup(); drpEmployee.DataSource = dataObj.Selectdatatable("select Id,EmployeeName from Ta_Employee where Status=1"); drpEmployee.DataTextField = "EmployeeName"; drpEmployee.DataValueField = "Id"; drpEmployee.DataBind(); drpEmployee.Items.Insert(0, "اختار العميل"); } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=53 and IsVaild=1"; DataTable dt1 = dataobj.Selectdatatable(sql1); if (dt1.Rows.Count == 1) { string sql = @"UserBackPruches " + Session["UserReportId"] + ",'" + DateTime.Parse(Session["DateFrom"].ToString()) + "','" + DateTime.Parse(Session["DateTo"].ToString()) + "'"; string path = "Reports/ReportUserBackPruches.rpt"; System.Drawing.Printing.PrintDocument printDocument = new System.Drawing.Printing.PrintDocument(); ReportDocument reportdocument = new ReportDocument(); reportdocument.Load(Server.MapPath(path)); reportdocument.DataSourceConnections[0].SetConnection(".", "ERPsystem", true); reportdocument.SetDataSource(dataobj.Selectdatatable(sql)); reportdocument.SetParameterValue("@userId", Session["UserReportId"]); reportdocument.SetParameterValue("@datefrom", DateTime.Parse(Session["DateFrom"].ToString())); reportdocument.SetParameterValue("@dateto", DateTime.Parse(Session["DateTo"].ToString())); CrystalReportViewer1.ReportSource = reportdocument; } else { Response.Redirect("MainPage.aspx"); } } catch { Response.Redirect("MainPage.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=42 and IsVaild=1"; DataTable dt1 = dataObj.Selectdatatable(sql1); if (dt1.Rows.Count != 1) { Response.Redirect("MainPage.aspx"); } BindgrdTrades(); drpGovernate.DataSource = dataObj.Selectdatatable("select Id,GovernateName from Ta_Governate"); drpGovernate.DataTextField = "GovernateName"; drpGovernate.DataValueField = "Id"; drpGovernate.DataBind(); drpGovernate.Items.Insert(0, "اسم المحافظة"); } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=66 and IsVaild=1"; DataTable dt1 = dataobj.Selectdatatable(sql1); if (dt1.Rows.Count == 1) { addValidationGroup(); string sql = @"select top(50)Code from BackSales order by DateOfSale desc"; drpType.DataSource = dataobj.Selectdatatable(sql); drpType.DataTextField = "Code"; drpType.DataValueField = "Code"; drpType.DataBind(); drpType.Items.Insert(0, "اختار"); } else { Response.Redirect("MainPage.aspx"); } } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=55 and IsVaild=1"; DataTable dt1 = dataobj.Selectdatatable(sql1); if (dt1.Rows.Count == 1) { addValidationGroup(); string sql = @"select Id,UserName from Users "; drpName.DataSource = dataobj.Selectdatatable(sql); drpName.DataTextField = "UserName"; drpName.DataValueField = "Id"; drpName.DataBind(); drpName.Items.Insert(0, "الاسم"); } else { Response.Redirect("MainPage.aspx"); } } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=54 and IsVaild=1"; DataTable dt1 = dataobj.Selectdatatable(sql1); if (dt1.Rows.Count == 1) { string sql = @"TreasureReport"; System.Drawing.Printing.PrintDocument printDocument = new System.Drawing.Printing.PrintDocument(); ReportDocument reportdocument = new ReportDocument(); reportdocument.Load(Server.MapPath("Reports/ReportTreasure.rpt")); reportdocument.DataSourceConnections[0].SetConnection(".", "ERPsystem", true); reportdocument.SetDataSource(dataobj.Selectdatatable(sql)); CrystalReportViewer1.ReportSource = reportdocument; //reportdocument.PrintOptions.PrinterName = printDocument.PrinterSettings.PrinterName; //reportdocument.PrintToPrinter(1, true, 1, 100); //Response.Redirect("MainReportTreasure.aspx"); } else { Response.Redirect("MainPage.aspx"); } } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { databaseaccesslayer dataobj = new databaseaccesslayer(); try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=38 and IsVaild=1"; DataTable dt1 = dataobj.Selectdatatable(sql1); if (dt1.Rows.Count != 1) { Response.Redirect("MainPage.aspx"); } if (Request.QueryString["Id"] != null && Request.QueryString["Id"].ToString() != "") { string sql = @"ReportBalanceEmployee " + Request.QueryString["Id"].ToString(); ReportDocument reportdocument = new ReportDocument(); reportdocument.Load(Server.MapPath("Reports/RepBalanceEmployees.rpt")); reportdocument.DataSourceConnections[0].SetConnection(".", "Lawer", true); reportdocument.SetDataSource(dataobj.Selectdatatable(sql)); reportdocument.SetParameterValue("@Id", int.Parse(Request.QueryString["Id"].ToString())); CrystalReportViewer1.ReportSource = reportdocument; } else { Response.Redirect("ReportDetailsIssue.aspx"); } } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=29 and IsVaild=1"; DataTable dt1 = dataObj.Selectdatatable(sql1); if (dt1.Rows.Count != 1) { Response.Redirect("MainPage.aspx"); } addValidationGroup(); drpEmployee.DataSource = dataObj.Selectdatatable("select Id,EmployeeName from Ta_Employee where Status=1"); drpEmployee.DataTextField = "EmployeeName"; drpEmployee.DataValueField = "Id"; drpEmployee.DataBind(); drpEmployee.Items.Insert(0, "اختار العميل"); drpType.Items.Insert(0, "اختار نوع الوثيقة"); drpType.Items.Insert(1, "وكالة عامة"); drpType.Items.Insert(2, "وكالة خاصة"); drpType.Items.Insert(3, "وكالة عدلية"); drpType.Items.Insert(4, "إقرار"); drpType.Items.Insert(5, "سند دين منظم"); drpType.Items.Insert(6, "تعهد عدلي"); drpType.Items.Insert(7, "صك ملكية"); drpType.Items.Insert(8, "أخري"); } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { databaseaccesslayer dataobj = new databaseaccesslayer(); if (!IsPostBack) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=12 and IsVaild=1"; DataTable dt1 = dataobj.Selectdatatable(sql1); if (dt1.Rows.Count != 1) { Response.Redirect("MainPage.aspx"); } string sql = @"ReportNotActiveIssue"; ReportDocument reportdocument = new ReportDocument(); reportdocument.Load(Server.MapPath("Reports/ReAllNotActiveIssue.rpt")); reportdocument.DataSourceConnections[0].SetConnection(".", "Lawer", true); reportdocument.SetDataSource(dataobj.Selectdatatable(sql)); CrystalReportViewer1.ReportSource = reportdocument; } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=37 and IsVaild=1"; DataTable dt1 = DataObj.Selectdatatable(sql1); if (dt1.Rows.Count == 1) { if (Page.Request.QueryString["code"] != "" && Page.Request.QueryString["code"] != null) { BindgrdTrades(); } else { Response.Redirect("Select-Sales.aspx"); } } else { Response.Redirect("MainPage.aspx"); } } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { databaseaccesslayer dataobj = new databaseaccesslayer(); string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=28 and IsVaild=1"; DataTable dt1 = dataobj.Selectdatatable(sql1); if (dt1.Rows.Count != 1) { Response.Redirect("MainPage.aspx"); } if (Request.QueryString["Status"] != null && Request.QueryString["Status"].ToString() != "" && Session["DateFrom"] != null && Session["DateFrom"].ToString() != "" && Session["DateTo"] != null && Session["DateTo"].ToString() != "") { string sql = @"ReportTask " + Request.QueryString["Status"].ToString() + ",'" + Session["DateFrom"] + "','" + Session["DateTo"] + "'"; ReportDocument reportdocument = new ReportDocument(); reportdocument.Load(Server.MapPath("Reports/RepAllTask.rpt")); reportdocument.DataSourceConnections[0].SetConnection(".", "Lawer", true); reportdocument.SetDataSource(dataobj.Selectdatatable(sql)); reportdocument.SetParameterValue("@Status", int.Parse(Request.QueryString["Status"].ToString())); reportdocument.SetParameterValue("@DateFrom", DateTime.Parse(Session["DateFrom"].ToString()).ToShortDateString()); reportdocument.SetParameterValue("@DateTo", DateTime.Parse(Session["DateTo"].ToString()).ToShortDateString()); CrystalReportViewer1.ReportSource = reportdocument; } else { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string sql = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=22 and IsVaild=1"; DataTable dt = dataobj.Selectdatatable(sql); if (dt.Rows.Count == 1) { string sqlStore = @"select Code,StoreName from Store"; drpSelect.DataSource = dataobj.Selectdatatable(sqlStore); drpSelect.DataValueField = "Code"; drpSelect.DataTextField = "StoreName"; drpSelect.DataBind(); drpSelect.Items.Insert(0, "اختار المخزن"); } else { Response.Redirect("MainPage.aspx"); } } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=43 and IsVaild=1"; DataTable dt1 = dataObj.Selectdatatable(sql1); if (dt1.Rows.Count != 1) { Response.Redirect("MainPage.aspx"); } string sql = @"select * from Ta_Sitting where AlertDate='" + DateTime.Now.ToShortDateString() + "' and Type=1"; DataTable dt = dataObj.Selectdatatable(sql); if (dt.Rows.Count > 0) { divSitting.Visible = true; BindgrdTrades(); } string sqlT = @"select * from Ta_Task where DateOfAlert='" + DateTime.Now.ToShortDateString() + "' and Status=1"; DataTable dts = dataObj.Selectdatatable(sqlT); if (dts.Rows.Count > 0) { divTask.Visible = true; BindgrdTradesTask(); } } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { addValidationGroup(); if (Page.Request.QueryString["code"] != "" && Page.Request.QueryString["code"] != null) { try{ string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=27 and IsVaild=1"; DataTable dt1 = databaseaccesslayerobj.Selectdatatable(sql1); if (dt1.Rows.Count == 1) { string sql = "select * from CustomerAndSupplier where Code='" + Request.QueryString["code"].ToString() + "'"; DataTable dt = databaseaccesslayerobj.Selectdatatable(sql); TxtCode.Text = dt.Rows[0]["Code"].ToString(); TxtARName.Text = dt.Rows[0]["Name"].ToString(); if (float.Parse(dt.Rows[0]["InitialBalance"].ToString()) >= 0) { txtMoney.Text = dt.Rows[0]["InitialBalance"].ToString(); RadioCustomer.Items.FindByValue("مدين").Selected = true; } else { float y = float.Parse(dt.Rows[0]["InitialBalance"].ToString()) * -1; txtMoney.Text = y.ToString(); RadioCustomer.Items.FindByValue("دائن").Selected = true; } DateTime dts = DateTime.Parse(dt.Rows[0]["DateOfDealing"].ToString()); string d = dts.ToString("MM/dd/yyyy"); txtDate.Text = d; chkActive.Checked = bool.Parse(dt.Rows[0]["Status"].ToString()); txtCompanyName.Text = dt.Rows[0]["CompanyName"].ToString(); txtResponsibility.Text = dt.Rows[0]["Responsibility"].ToString(); txtTelephone.Text = dt.Rows[0]["Mobil"].ToString(); txtTelephone1.Text = dt.Rows[0]["Mobil1"].ToString(); txtTelephone2.Text = dt.Rows[0]["Mobil2"].ToString(); } else { Response.Redirect("MainPage.aspx"); } } catch (Exception) { Response.Redirect("MainPageaspx"); } } else { Response.Redirect("select-Customer.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=23 and IsVaild=1"; DataTable dt1 = dataObj.Selectdatatable(sql1); if (dt1.Rows.Count != 1) { Response.Redirect("Select_Consultation.aspx"); } addValidationGroup(); drpEmployee.DataSource = dataObj.Selectdatatable("select Id,EmployeeName from Ta_Employee where Status=1"); drpEmployee.DataTextField = "EmployeeName"; drpEmployee.DataValueField = "Id"; drpEmployee.DataBind(); drpEmployee.Items.Insert(0, "اختار العميل"); drpUser.DataSource = dataObj.Selectdatatable("select Id,UserName from Ta_Users"); drpUser.DataTextField = "UserName"; drpUser.DataValueField = "Id"; drpUser.DataBind(); drpUser.Items.Insert(0, "أختار المسئول"); if (Page.Request.QueryString["Id"] != "" && Page.Request.QueryString["Id"] != null) { string sql = "select * from Ta_Consultation where Id='" + Request.QueryString["Id"].ToString() + "'"; DataTable dt = dataObj.Selectdatatable(sql); txtNotes.Text = dt.Rows[0]["Notes"].ToString(); txtDate.Text = DateTime.Parse(dt.Rows[0]["DateOfConsultation"].ToString()).ToShortDateString(); txtType.Text = dt.Rows[0]["Type"].ToString(); drpEmployee.SelectedValue = dt.Rows[0]["Employee_Id"].ToString(); drpUser.SelectedValue = dt.Rows[0]["User_Id"].ToString(); txtTasnif.Text = dt.Rows[0]["PublicRate"].ToString(); txtStage.Text = dt.Rows[0]["Stage"].ToString(); txtSubject.Text = dt.Rows[0]["Subject"].ToString(); txtDescription.Text = dt.Rows[0]["Description"].ToString(); txtAnswer.Text = dt.Rows[0]["Answer"].ToString(); } else { Response.Redirect("Select_Consultation.aspx"); } } catch (Exception) { } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=56 and IsVaild=1"; DataTable dt1 = dataobj.Selectdatatable(sql1); if (dt1.Rows.Count == 1) { drpType.Items.Insert(0, "اختار"); drpType.Items.Insert(1, "عملاء"); drpType.Items.Insert(2, "موردين"); } else { Response.Redirect("MainPage.aspx"); } } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=5 and IsVaild=1"; DataTable dt1 = dataObj.Selectdatatable(sql1); if (dt1.Rows.Count != 1) { Response.Redirect("MainPage.aspx"); } addValidationGroup(); //drpDescrip.DataSource = dataObj.Selectdatatable("select Id,TypeDescription from Ta_EmployeeDescription"); //drpDescrip.DataTextField = "TypeDescription"; //drpDescrip.DataValueField = "Id"; //drpDescrip.DataBind(); //drpDescrip.Items.Insert(0, "اختار الصفة"); drpType.Items.Insert(0, "نوع العميل"); drpType.Items.Insert(1, "أفراد"); drpType.Items.Insert(2, "شركات"); drpStatus.Items.Insert(0, "اختار الحالة"); drpStatus.Items.Insert(1, "نشط"); drpStatus.Items.Insert(2, "غير نشط"); } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try{ string sql = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=2 and IsVaild=1"; DataTable dt = DataObj.Selectdatatable(sql); if (dt.Rows.Count != 1) { Response.Redirect("MainPage.aspx"); } BindgrdTrades(); } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=44 and IsVaild=1"; DataTable dt1 = dataobj.Selectdatatable(sql1); if (dt1.Rows.Count == 1) { BindgrdTrades(); CreateGuid(); addValidationGroup(); } else { Response.Redirect("MainPage.aspx"); } } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { addValidationGroup(); for (int i = 1; i < 13; i++) { drpMonth.Items.Add(i.ToString()); } for (int i = 1; i < 31; i++) { drpDay.Items.Add(i.ToString()); } if (Page.Request.QueryString["code"] != "" && Page.Request.QueryString["code"] != null) { try{ string sql = "SelectMonthlyInstallmentsByCode '" + Request.QueryString["code"].ToString() + "'"; DataTable dt = databaseaccesslayerobj.Selectdatatable(sql); DateTime dts = DateTime.Parse(dt.Rows[0]["DateOfInstallments"].ToString()); string d = dts.ToString("MM/dd/yyyy"); txtCode.Text = dt.Rows[0]["Code"].ToString(); txtDate.Text = d; txtName.Text = dt.Rows[0]["Name"].ToString(); txtAmount.Text = dt.Rows[0]["Amount"].ToString(); txtWin.Text = dt.Rows[0]["ProfitPremium"].ToString(); labTotal.Text = dt.Rows[0]["InstallmentAmount"].ToString(); txtNum.Text = dt.Rows[0]["NumOfInstallment"].ToString(); drpMonth.Text = dt.Rows[0]["BeginMonth"].ToString(); drpDay.Text = dt.Rows[0]["PaymentDay"].ToString(); string sqldata = "select Date as التاريخ,Amount as المبلغ from MonthlyInstallmentsDetails where code='" + Request.QueryString["code"].ToString() + "'"; grdInstallment.DataSource = databaseaccesslayerobj.Selectdatatable(sqldata); grdInstallment.DataBind(); } catch (Exception) { Response.Redirect("Select_MonthlyInstallments.aspx"); } } else { Response.Redirect("Select_MonthlyInstallments.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["Id"] == null || Session["Id"].ToString().Trim() == "") { Response.Redirect("Login.aspx"); } else { string setting = "select * from Ta_Sitting where AlertDate='" + DateTime.Now.ToShortDateString() + "' and Type=1"; DataTable settingcount = dataobj.Selectdatatable(setting); string Task = "select * from Ta_Task where DateOfAlert='" + DateTime.Now.ToShortDateString() + "' and Status=1"; DataTable TaskCount = dataobj.Selectdatatable(Task); if (TaskCount.Rows.Count > 0 || settingcount.Rows.Count > 0) { div.Visible = true; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string setting = "select * from Ta_Sitting where AlertDate='" + DateTime.Now.ToShortDateString() + "' and Type=1"; DataTable settingcount = dataobj.Selectdatatable(setting); string Task = "select * from Ta_Task where DateOfAlert='" + DateTime.Now.ToShortDateString() + "' and Status=1"; DataTable TaskCount = dataobj.Selectdatatable(Task); if (TaskCount.Rows.Count > 0 || settingcount.Rows.Count > 0) { div.Visible = true; } } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { addValidationGroup(); if (Page.Request.QueryString["code"] != "" && Page.Request.QueryString["code"] != null) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=13 and IsVaild=1"; DataTable dt1 = databaseaccesslayerobj.Selectdatatable(sql1); if (dt1.Rows.Count == 1) { string sql = "select * from Items where BarCode='" + Request.QueryString["code"].ToString() + "'"; DataTable dt = databaseaccesslayerobj.Selectdatatable(sql); TxtCode.Text = dt.Rows[0]["Code"].ToString(); TxtName.Text = dt.Rows[0]["ItemName"].ToString(); TxtBarCode.Text = dt.Rows[0]["BarCode"].ToString(); chkActive.Checked = bool.Parse(dt.Rows[0]["Status"].ToString()); chkDate.Checked = bool.Parse(dt.Rows[0]["DateOfItem"].ToString()); txtSale.Text = dt.Rows[0]["ItemSaleType"].ToString(); txtPruch.Text = dt.Rows[0]["ItemPruchType"].ToString(); txtNum.Text = dt.Rows[0]["Quantity"].ToString(); txtNotes.Text = dt.Rows[0]["Notes"].ToString(); txtPricePruch.Text = dt.Rows[0]["pruchPrice"].ToString(); txtPriceSale.Text = dt.Rows[0]["SalePrice"].ToString(); } else { Response.Redirect("Select-Item.aspx"); } } catch (Exception) { Response.Redirect("Select-Item.aspx"); } } else { Response.Redirect("Select-Item.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=9 and IsVaild=1"; DataTable dt1 = dataObj.Selectdatatable(sql1); if (dt1.Rows.Count != 1) { Response.Redirect("MainPage.aspx"); } addValidationGroup(); generateguid(); drpGovenate.DataSource = dataObj.Selectdatatable("select Id,GovernateName from Ta_Governate"); drpGovenate.DataTextField = "GovernateName"; drpGovenate.DataValueField = "Id"; drpGovenate.DataBind(); drpGovenate.Items.Insert(0, "أختار المحافظة"); drpEmployee.DataSource = dataObj.Selectdatatable("select Id,EmployeeName from Ta_Employee where Status=1"); drpEmployee.DataTextField = "EmployeeName"; drpEmployee.DataValueField = "Id"; drpEmployee.DataBind(); drpEmployee.Items.Insert(0, "اختار العميل"); drpUser.DataSource = dataObj.Selectdatatable("select Id,UserName from Ta_Users"); drpUser.DataTextField = "UserName"; drpUser.DataValueField = "Id"; drpUser.DataBind(); drpUser.Items.Insert(0, "أختار المسئول"); drpStatus.Items.Insert(0, "اختار الحالة"); drpStatus.Items.Insert(1, "نشطة"); drpStatus.Items.Insert(2, "ارشيف"); } catch (Exception) { Response.Redirect("MainPage.aspx"); } } }
public void SelectItem(string code, string item, float quantity, string type) { try { List <ItemOrder> more = new List <ItemOrder> { }; string sql = @"select BarCode ,ItemName,o.Quantity as quantity,Type from OrderDetails o left join Items i on o.Item_Id=i.Code where [OrderCode]='" + code + "' and [Item_Id]=(select Code from Items where ItemName='" + item + "') and o.[Quantity]=" + quantity + " and [Type]='" + type + "'"; DataTable dt = dataobj.Selectdatatable(sql); more.Add(new ItemOrder { Code = dt.Rows[0]["BarCode"].ToString(), Item = dt.Rows[0]["ItemName"].ToString(), quantity = float.Parse(dt.Rows[0]["quantity"].ToString()), Type = dt.Rows[0]["Type"].ToString() }); var json = new JavaScriptSerializer().Serialize(more); Context.Response.Write(json); DeleteOrder(code, item, quantity, type); } catch (Exception ex) { var list = Key._KeyValuePair("Error", ex.Message); var json = new JavaScriptSerializer().Serialize(list); Context.Response.Write(json); } }