Ejemplo n.º 1
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (drpGovernate.SelectedIndex > 0)
         {
             string    sqlcheck = "select * from [dbo].[Ta_LawerPlace] where Name='" + txtName.Text + "' and [Governate_Id]=" + drpGovernate.SelectedItem.Value;
             DataTable dt       = dataObj.Selectdatatable(sqlcheck);
             if (dt.Rows.Count == 0)
             {
                 string sql = @"INSERT INTO [dbo].[Ta_LawerPlace] ([Name],[Address],[Telephone],[Governate_Id],[Notes]) VALUES(@1,@2,@3,@4,@5)";
                 dataObj.Execute(sql, txtName.Text, txtAddress.Text, txtMobil.Text, drpGovernate.SelectedItem.Value, txtStatment.Text);
                 helper.cleartxt(UpdatePanel1);
                 drpGovernate.SelectedIndex = 0;
                 dataObj.Alert("Success", this);
             }
             else
             {
                 dataObj.Alert("هذه البيانات موجودة من قبل", this);
             }
         }
     }
     catch (Exception ex)
     {
         dataObj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            string sql = @"INSERT INTO [dbo].[Ta_PayMoney]
           ([DateOfOperation]
           ,[Employee_Id]
           ,[Amount]
           ,[Notes]
           ,[Type])
     VALUES
           (@1,@2,@3,@4,@5)";
            dataObj.Execute(sql, DateTime.Parse(txtDate.Text), drpEmployee.SelectedItem.Value, float.Parse(txtAmount.Text), txtNotes.Text, "سند قبض");

            string Up = @"UPDATE [dbo].[Ta_Employee]
   SET [Balance] = [Balance]-@1
 WHERE [Id]=@2";
            dataObj.Execute(Up, float.Parse(txtAmount.Text), drpEmployee.SelectedItem.Value);

            helper.cleartxt(UpdatePanel1);
            drpEmployee.SelectedIndex = 0;
            dataObj.Alert("تم الحفظ بنجاح", this);
        }
        catch (Exception ex)
        {
            dataObj.Alert(ex.Message, this);
        }
    }
Ejemplo n.º 3
0
 protected void btnPuplish_Click(object sender, EventArgs e)
 {
     try
     {
         string sql = "delete from [dbo].[tempMonthlyInstallmentsDetails] where code=@1";
         databaseaccesslayerobj.Execute(sql, txtCode.Text);
         int    year      = DateTime.Now.Year;
         string InsertSql = "INSERT INTO [dbo].[tempMonthlyInstallmentsDetails] ([Code],[Date],[Amount],[IsVaild]) VALUES (@1,@2,@3,@4)";
         int    x         = int.Parse(txtNum.Text);
         float  Total     = float.Parse(txtAmount.Text) / x;
         for (int i = 1; i <= x; i++)
         {
             int num = (int.Parse(drpMonth.Text) + i - 1);
             if (num <= 12)
             {
                 string date = num + "-" + drpDay.Text + "-" + year;
                 databaseaccesslayerobj.Execute(InsertSql, txtCode.Text, date, Total, 0);
             }
             else
             {
                 string date = (num - 12) + "-" + (int.Parse(drpDay.Text) + 1) + "-" + year;
                 databaseaccesslayerobj.Execute(InsertSql, txtCode.Text, date, Total, 0);
             }
         }
         grdInstallment.DataSource = databaseaccesslayerobj.Selectdatatable("select [Date] as التاريخ,[Amount] as المبلغ from tempMonthlyInstallmentsDetails where code='" + txtCode.Text + "'");
         grdInstallment.DataBind();
         btnSave.Enabled = true;
     }
     catch (Exception ex)
     {
         databaseaccesslayerobj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 4
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         int x = 1;
         if (checkStatus.Checked == true)
         {
             x = 0;
         }
         string sql = @"INSERT INTO [dbo].[Ta_Task]
        ([DateOfTask]
        ,[TaskName]
        ,[TaskType]
        ,[DateOfAlert]
        ,[Notes]
        ,[Status])
  VALUES
        (@1,@2,@3,@4,@5,@6)";
         dataObj.Execute(sql, DateTime.Parse(txtDate.Text).ToShortDateString(), txtName.Text, txtType.Text, DateTime.Parse(txtDateAlert.Text).ToShortDateString(), txtNotes.Text, x);
         helper.cleartxt(UpdatePanel1);
         checkStatus.Checked = false;
         dataObj.Alert("تم الحفظ بنجاح", this);
     }
     catch (Exception ex)
     {
         dataObj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 5
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            string sql = @"UPDATE [dbo].[Ta_Consultation]
   SET [DateOfConsultation] = @1
      ,[Employee_Id] = @2
      ,[User_Id] = @3
      ,[Type] = @4
      ,[PublicRate] = @5
      ,[Stage] = @6
      ,[Subject] = @7
      ,[Notes] = @8
      ,[Description] = @9
      ,[Answer] = @10
 WHERE [Id]=@11";
            dataObj.Execute(sql, DateTime.Parse(txtDate.Text).ToShortDateString(), drpEmployee.SelectedItem.Value, drpUser.SelectedItem.Value, txtType.Text,
                            txtTasnif.Text, txtStage.Text, txtSubject.Text, txtNotes.Text, txtDescription.Text, txtAnswer.Text, Request.QueryString["Id"].ToString());
            Response.Redirect("Select_Consultation.aspx");
        }
        catch (Exception ex)
        {
            dataObj.Alert(ex.Message, this);
        }
    }
Ejemplo n.º 6
0
 protected void btnReport_Click(object sender, EventArgs e)
 {
     try
     {
         if (!string.IsNullOrWhiteSpace(txtNumber.Text))
         {
             string    sql = "select * from Ta_Issue where IssueNumber='" + txtNumber.Text + "'";
             DataTable dt  = dataobj.Selectdatatable(sql);
             if (dt.Rows.Count == 1)
             {
                 Response.Redirect("ReportIssueDetails.aspx?Number=" + txtNumber.Text);
             }
             else
             {
                 dataobj.Alert("Error", this);
             }
         }
         else
         {
             dataobj.Alert("من فضلك ادخل رقم القضية", this);
         }
     }
     catch (Exception)
     {
     }
 }
Ejemplo n.º 7
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         int x = 0;
         if (RadioCustomer.SelectedValue == "مدين")
         {
             x = int.Parse(txtMoney.Text);
         }
         else
         {
             x = int.Parse(txtMoney.Text) * -1;
         }
         DateTime dt  = DateTime.Parse(txtDate.Text);
         string   d   = dt.ToString("MM-dd-yyyy");
         string   sql = @"INSERT INTO [dbo].[CustomerAndSupplier] ([Code],[Name],[InitialBalance],[DateOfDealing],[Status],[CompanyName],[Responsibility],[Mobil],[Mobil1],[Mobil2],[Customer],[Supplier]) VALUES(@1,@2,@3,@4,@5,@6,@7,@8,@9,@10,@11,@12)";
         databaseaccesslayerobj.Execute(sql, TxtCode.Text, TxtARName.Text, x, d, chkActive.Checked, txtCompanyName.Text, txtResponsibility.Text, txtTelephone.Text, txtTelephone1.Text, txtTelephone2.Text, false, true);
         databaseaccesslayerobj.Alert("success", this);
         helper.cleartxt(UpdatePanel1);
         generateguid();
         chkActive.Checked = false;
     }
     catch (Exception ex)
     {
         databaseaccesslayerobj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 8
0
 private void BindgrdTrades()
 {
     try
     {
         if (Radio.SelectedValue == "نشط")
         {
             string sql = @"select BarCode as الباركود,ItemName as اسم_الصنف,DateOfItem as له_تاريخ_صلاحية,Notes as ملاحظات from Items where Status=1";
             grdSelect.DataSource = DataObj.Selectdatatable(sql);
             grdSelect.DataBind();
         }
         else if (Radio.SelectedValue == "غير نشط")
         {
             string sql = @"select BarCode as الباركود,ItemName as اسم_الصنف,DateOfItem as له_تاريخ_صلاحية,Notes as ملاحظات from Items where Status=0";
             grdSelect.DataSource = DataObj.Selectdatatable(sql);
             grdSelect.DataBind();
         }
         else
         {
             string sql = @"select BarCode as الباركود,ItemName as اسم_الصنف,DateOfItem as له_تاريخ_صلاحية,Notes as ملاحظات from Items";
             grdSelect.DataSource = DataObj.Selectdatatable(sql);
             grdSelect.DataBind();
         }
     }
     catch (Exception ex)
     {
         DataObj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 9
0
 private void BindgrdTrades()
 {
     try
     {
         int x = 0;
         if (RadioType.SelectedValue == "نشط")
         {
             x = 1;
         }
         if (txtSearch.Text.Trim() != "")
         {
             gridSelect.DataSource = dataObj.Selectdatatable("select Id as الكود,EmployeeName as اسم_العميل,Adderss as العنوان,EmployeeType as نوع_العميل,EmployeeJob as المهنة,DateOfBirth as تاريخ_الميلاد,Nationality as الجنسية,NationalNumber as الرقم_القومي,Phone as الهاتف,Mobil as الموبيل,Email as الايميل,Notes as ملاحظات from Ta_Employee where Status=" + x + " and EmployeeName like '%" + txtSearch.Text + "%'");
             gridSelect.DataBind();
         }
         else
         {
             gridSelect.DataSource = dataObj.Selectdatatable("select Id as الكود,EmployeeName as اسم_العميل,Adderss as العنوان,EmployeeType as نوع_العميل,EmployeeJob as المهنة,DateOfBirth as تاريخ_الميلاد,Nationality as الجنسية,NationalNumber as الرقم_القومي,Phone as الهاتف,Mobil as الموبيل,Email as الايميل,Notes as ملاحظات from Ta_Employee where Status=" + x);
             gridSelect.DataBind();
         }
     }
     catch (Exception ex)
     {
         dataObj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 10
0
 private void BindgrdTrades()
 {
     try
     {
         string sql = @"select Id as الكود,FormName as الاسم from Application";
         grdSelect.DataSource = dataobj.Selectdatatable(sql);
         grdSelect.DataBind();
         string    sql1 = @"select Appl_Id from Application_Setting where User_Id=(select Id from Users where UserName='******')";
         DataTable dt   = dataobj.Selectdatatable(sql1);
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             for (int j = 0; j < grdSelect.Rows.Count; j++)
             {
                 if (dt.Rows[i]["Appl_Id"].ToString() == grdSelect.Rows[j].Cells[1].Text)
                 {
                     CheckBox c = (grdSelect.Rows[j].Cells[0].FindControl("btnCheckAll") as CheckBox);
                     c.Checked = true;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         dataobj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 11
0
 private void BindgrdTrades()
 {
     try
     {
         if (drpIssueNumber.SelectedIndex > 0 && txtDateFrom.Text.Trim() != "" && txtDateTo.Text.Trim() != "")
         {
             gridSelect.DataSource = dataObj.Selectdatatable("select IssueNumber as رقم_القضية,HakamName as القاضي,SittingTime as الميعاد,SittingDate as التاريخ,s.Notes as ملاحظات from Ta_Sitting s left join Ta_Issue i on s.Issue_Id=i.Id where Type=1 and s.Issue_Id=" + drpIssueNumber.SelectedItem.Value + " and SittingDate between '" + DateTime.Parse(txtDateFrom.Text).ToShortDateString() + "' and '" + DateTime.Parse(txtDateTo.Text).ToShortDateString() + "' order by i.Id desc");
             gridSelect.DataBind();
         }
         else if (drpIssueNumber.SelectedIndex > 0)
         {
             gridSelect.DataSource = dataObj.Selectdatatable("select IssueNumber as رقم_القضية,HakamName as القاضي,SittingTime as الميعاد,SittingDate as التاريخ,s.Notes as ملاحظات from Ta_Sitting s left join Ta_Issue i on s.Issue_Id=i.Id where Type=1 and s.Issue_Id=" + drpIssueNumber.SelectedItem.Value + " order by i.Id desc");
             gridSelect.DataBind();
         }
         else
         {
             gridSelect.DataSource = null;
             gridSelect.DataBind();
         }
     }
     catch (Exception ex)
     {
         dataObj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 12
0
 private void BindgrdTrades()
 {
     try
     {
         if (RadioCustomer.SelectedValue == "نشط")
         {
             string sql = @"select Code as الكود,Name as الاسم,InitialBalance as الحساب_الحالي,Mobil as موبيل1,mobil1 as موبيل2,Mobil2 as موبيل3 from CustomerAndSupplier  where Supplier=1 and Status=1";
             grdSelect.DataSource = DataObj.Selectdatatable(sql);
             grdSelect.DataBind();
         }
         else if (RadioCustomer.SelectedValue == "غير نشط")
         {
             string sql = @"select Code as الكود,Name as الاسم,InitialBalance as الحساب_الحالي,Mobil as موبيل1,mobil1 as موبيل2,Mobil2 as موبيل3 from CustomerAndSupplier  where Supplier=1 and Status=0";
             grdSelect.DataSource = DataObj.Selectdatatable(sql);
             grdSelect.DataBind();
         }
         else
         {
             string sql = @"select Code as الكود,Name as الاسم,InitialBalance as الحساب_الحالي,Mobil as موبيل1,mobil1 as موبيل2,Mobil2 as موبيل3 from CustomerAndSupplier  where Supplier=1";
             grdSelect.DataSource = DataObj.Selectdatatable(sql);
             grdSelect.DataBind();
         }
     }
     catch (Exception ex)
     {
         DataObj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 13
0
 private void BindgrdTrades()
 {
     try
     {
         if (RadioCustomer.SelectedValue == "نشط")
         {
             string sql = @"select Code as الكود,StoreName as اسم_المخزن,Responsibility as المسئول,StoreTel as تليفون_المخزن,mobil as تليفون_المسئول,StoreAddress as عنوان_المخزن from Store where Status=1";
             grdSelect.DataSource = DataObj.Selectdatatable(sql);
             grdSelect.DataBind();
         }
         else if (RadioCustomer.SelectedValue == "غير نشط")
         {
             string sql = @"select Code as الكود,StoreName as اسم_المخزن,Responsibility as المسئول,StoreTel as تليفون_المخزن,mobil as تليفون_المسئول,StoreAddress as عنوان_المخزن from Store where Status=0";
             grdSelect.DataSource = DataObj.Selectdatatable(sql);
             grdSelect.DataBind();
         }
         else
         {
             string sql = @"select Code as الكود,StoreName as اسم_المخزن,Responsibility as المسئول,StoreTel as تليفون_المخزن,mobil as تليفون_المسئول,StoreAddress as عنوان_المخزن from Store";
             grdSelect.DataSource = DataObj.Selectdatatable(sql);
             grdSelect.DataBind();
         }
     }
     catch (Exception ex)
     {
         DataObj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 14
0
 private void BindgrdTrades()
 {
     try
     {
         if (drpEmployee.SelectedIndex > 0 && txtDateFrom.Text.Trim() != "" && txtDateTo.Text.Trim() != "")
         {
             gridSelect.DataSource = dataObj.Selectdatatable("select c.Id as الكود,EmployeeName as العميل,UserName as المسئول,Type as نوع_الاستشارة,PublicRate as التصنيف_العام,Stage as المرحلة_الحالية,Subject as الموضوع from Ta_Consultation c left join Ta_Employee e on c.Employee_Id=e.Id left join Ta_Users u on c.User_Id=u.Id where c.Employee_Id=" + drpEmployee.SelectedItem.Value + " and DateOfConsultation between '" + DateTime.Parse(txtDateFrom.Text).ToShortDateString() + "' and '" + DateTime.Parse(txtDateTo.Text).ToShortDateString() + "' order by DateOfConsultation desc");
             gridSelect.DataBind();
         }
         else if (drpEmployee.SelectedIndex > 0)
         {
             gridSelect.DataSource = dataObj.Selectdatatable("select c.Id as الكود,EmployeeName as العميل,UserName as المسئول,Type as نوع_الاستشارة,PublicRate as التصنيف_العام,Stage as المرحلة_الحالية,Subject as الموضوع from Ta_Consultation c left join Ta_Employee e on c.Employee_Id=e.Id left join Ta_Users u on c.User_Id=u.Id where c.Employee_Id=" + drpEmployee.SelectedItem.Value + " order by DateOfConsultation desc");
             gridSelect.DataBind();
         }
         else
         {
             gridSelect.DataSource = null;
             gridSelect.DataBind();
         }
     }
     catch (Exception ex)
     {
         dataObj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 15
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         string sql = @"INSERT INTO [dbo].[Ta_Consultation]
        ([DateOfConsultation]
        ,[Employee_Id]
        ,[User_Id]
        ,[Type]
        ,[PublicRate]
        ,[Stage]
        ,[Subject]
        ,[Notes]
        ,[Description]
        ,[Answer])
  VALUES
        (@1,@2,@3,@4,@5,@6,@7,@8,@9,@10)";
         dataObj.Execute(sql, DateTime.Parse(txtDate.Text).ToShortDateString(), drpEmployee.SelectedItem.Value, drpUser.SelectedItem.Value, txtType.Text,
                         txtTasnif.Text, txtStage.Text, txtSubject.Text, txtNotes.Text, txtDescription.Text, txtAnswer.Text);
         helper.cleartxt(UpdatePanel1);
         drpUser.SelectedIndex = drpEmployee.SelectedIndex = 0;
         dataObj.Alert("تم الحفظ بنجاح", this);
     }
     catch (Exception ex)
     {
         dataObj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 16
0
 private void BindgrdTrades()
 {
     try
     {
         gridSelect.DataSource = dataObj.Selectdatatable("select i.IssueNumber as رقم_القضية,HakemName as القاضي,SittingTime as الوقت,S.SittingDate as التاريخ,s.Notes as ملاحظات from Ta_Sitting s left join Ta_Issue i on s.Issue_Id=i.Id where AlertDate='" + DateTime.Now.ToShortDateString() + "' and Type=1");
         gridSelect.DataBind();
     }
     catch (Exception ex)
     {
         dataObj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 17
0
 private void BindgrdTrades()
 {
     try
     {
         string sql = "select Code as كود,Name as الاسم,AddMoney as أضافة,Discount as خصم,Total as الاجمالي,Notes as ملاحظات from ShowPrices";
         grdSelect.DataSource = DataObj.Selectdatatable(sql);
         grdSelect.DataBind();
     }
     catch (Exception ex)
     {
         DataObj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 18
0
 private void BindgrdTrades()
 {
     try
     {
         string sql = @"select Id as الكود,FormName as الاسم from Application";
         grdSelect.DataSource = dataobj.Selectdatatable(sql);
         grdSelect.DataBind();
     }
     catch (Exception ex)
     {
         dataobj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 19
0
 private void BindgrdTrades()
 {
     try
     {
         drpSelect.Items.Insert(0, "اختار");
         drpSelect.Items.Insert(1, "عملاء");
         drpSelect.Items.Insert(2, "موردين");
     }
     catch (Exception ex)
     {
         dataobj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 20
0
 private void BindgrdTrades()
 {
     try
     {
         string sql = @"select GovernateName as اسم_المحافظة from Ta_Governate";
         gridSelect.DataSource = dataObj.Selectdatatable(sql);
         gridSelect.DataBind();
     }
     catch (Exception ex)
     {
         dataObj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 21
0
 private void BindgrdTrades()
 {
     try
     {
         string sql = @" select BarCode as الباركود,ItemName as اسم_الصنف,Notes as ملاحظات from ItemStore ii left join Items i on ii.ItemCode=i.Code left join Store s on ii.StoreCode=s.Code where StoreCode='" + drpselect.SelectedItem.Value + "'";
         grdSelect.DataSource = DataObj.Selectdatatable(sql);
         grdSelect.DataBind();
     }
     catch (Exception ex)
     {
         DataObj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 22
0
 private void BindgrdTrades()
 {
     try
     {
         string sql = @"select Name as الاسم,UserName as اسم_المستخدم,Mobil as الموبيل,Address as العنوان,Email as الايميل from Ta_Users";
         gridSelect.DataSource = dataObj.Selectdatatable(sql);
         gridSelect.DataBind();
     }
     catch (Exception ex)
     {
         dataObj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 23
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         string sql = @"INSERT INTO [dbo].[Store] ([Code],[StoreName],[StoreTel],[Status],[Responsibility],[Mobil],[StoreAddress]) VALUES(@1,@2,@3,@4,@5,@6,@7)";
         databaseaccesslayerobj.Execute(sql, txtStoreNumber.Text, txtARStoreName.Text, txtPhone.Text, chkActive.Checked, txtARManager.Text, txtMobile.Text, txtARAddress.Text);
         databaseaccesslayerobj.Alert("Success", this);
         helper.cleartxt(UpdatePanel1);
         CreateGuid();
     }
     catch (Exception ex)
     {
         databaseaccesslayerobj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 24
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         string sql = @"INSERT INTO [dbo].[Items] ([Code],[ItemName],[BarCode],[Status],[DateOfItem],[ItemSaleType],[ItemPruchType],[Quantity],[Notes],[pruchPrice],[SalePrice]) VALUES(@1,@2,@3,@4,@5,@6,@7,@8,@9,@10,@11)";
         databaseaccesslayerobj.Execute(sql, TxtCode.Text, TxtName.Text, TxtBarCode.Text, chkActive.Checked, chkDate.Checked, txtSale.Text, txtPruch.Text, float.Parse(txtNum.Text), txtNotes.Text, float.Parse(txtPricePruch.Text), float.Parse(txtPriceSale.Text));
         databaseaccesslayerobj.Alert("Success", this);
         helper.cleartxt(UpdatePanel1);
         CreateGuid();
     }
     catch (Exception ex)
     {
         databaseaccesslayerobj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 25
0
 private void BindgrdTrades()
 {
     try
     {
         if (drpEmployee.SelectedIndex > 0 && txtDateFrom.Text.Trim() != "" && txtDateTo.Text.Trim() != "")
         {
             gridSelect.DataSource = dataObj.Selectdatatable("select top(30) DateOfOperation as التاريخ,EmployeeName as العميل,Amount as المبلغ,Type as النوع,p.Notes as ملاحظات from Ta_PayMoney p left join Ta_Employee e on p.Employee_Id=e.Id where Employee_Id=" + drpEmployee.SelectedItem.Value + "  and DateOfOperation between '" + DateTime.Parse(txtDateFrom.Text).ToShortDateString() + "' and '" + DateTime.Parse(txtDateTo.Text).ToShortDateString() + "' order by P.Id desc");
             gridSelect.DataBind();
         }
         else if (drpEmployee.SelectedIndex > 0)
         {
             gridSelect.DataSource = dataObj.Selectdatatable("select top(30) DateOfOperation as التاريخ,EmployeeName as العميل,Amount as المبلغ,Type as النوع,p.Notes as ملاحظات from Ta_PayMoney p left join Ta_Employee e on p.Employee_Id=e.Id where Employee_Id=" + drpEmployee.SelectedItem.Value + " order by P.Id desc");
             gridSelect.DataBind();
         }
         else
         {
             gridSelect.DataSource = null;
             gridSelect.DataBind();
         }
     }
     catch (Exception ex)
     {
         dataObj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 26
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         int x = 0;
         if (RadioCustomer.SelectedValue == "مدين")
         {
             x = int.Parse(txtMoney.Text);
         }
         else
         {
             x = int.Parse(txtMoney.Text) * -1;
         }
         DateTime dt  = DateTime.Parse(txtDate.Text);
         string   d   = dt.ToString("MM-dd-yyyy");
         string   sql = @"UPDATE [dbo].[CustomerAndSupplier] SET [Name] = @1,[InitialBalance] = @2,[DateOfDealing] = @3,[Status] = @4,
                     [CompanyName] = @5,[Responsibility] = @6,[Mobil] = @7,[Mobil1] = @8,[Mobil2] = @9 WHERE [Code]=@10";
         databaseaccesslayerobj.Execute(sql, TxtARName.Text, x, d, chkActive.Checked, txtCompanyName.Text, txtResponsibility.Text, txtTelephone.Text, txtTelephone1.Text, txtTelephone2.Text, Request.QueryString["code"].ToString());
         string    sqlsel = @"select * from CustomerAndSupplier where Customer=1 and code='" + Request.QueryString["code"].ToString() + "'";
         DataTable dts    = databaseaccesslayerobj.Selectdatatable(sqlsel);
         if (dts.Rows.Count == 1)
         {
             Response.Redirect("select-Customer.aspx");
         }
         else if (dts.Rows.Count == 0)
         {
             Response.Redirect("select-Supplier.aspx");
         }
     }
     catch (Exception ex)
     {
         databaseaccesslayerobj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 27
0
 private void BindgrdTrades()
 {
     try
     {
         if (drpStore.SelectedIndex > 0 && txtName.Text == "")
         {
             string sql = @"select BarCode as الباركود,ItemName as اسم_الصنف,(select SUM(Quantity) from TransactionOfStore where ItemId=ii.Code and Store_Id=i.StoreCode) as الكمية from ItemStore i left join Items ii on i.ItemCode=ii.Code where i.StoreCode='" + drpStore.SelectedItem.Value + "'";
             grdSelect.DataSource = DataObj.Selectdatatable(sql);
             grdSelect.DataBind();
         }
         else if (drpStore.SelectedIndex > 0 && txtName.Text != "")
         {
             string sql = @"select BarCode as الباركود,ItemName as اسم_الصنف,(select SUM(Quantity) from TransactionOfStore where ItemId=ii.Code and Store_Id=i.StoreCode) as الكمية from ItemStore i left join Items ii on i.ItemCode=ii.Code where i.StoreCode='" + drpStore.SelectedItem.Value + "' and ItemName like '%" + txtName.Text + "%'";
             grdSelect.DataSource = DataObj.Selectdatatable(sql);
             grdSelect.DataBind();
         }
         else
         {
             grdSelect.DataSource = null;
             grdSelect.DataBind();
         }
     }
     catch (Exception ex)
     {
         DataObj.Alert(ex.Message, this);
     }
 }
 private void BindgrdTrades()
 {
     try
     {
         if (txtName.Text != "" && txtDateFrom.Text.Trim() == "" && txtDateTo.Text.Trim() == "")
         {
             string sql = @"select top(50)TypeOfOperation as نوع_العملية,Amount as المبلغ,DateOfOperation تاريخ_العملية from TransactionOfTreasure where TypeOfOperation like '%" + txtName.Text + "%' order by DateOfOperation desc";
             grdSelect.DataSource = DataObj.Selectdatatable(sql);
             grdSelect.DataBind();
         }
         else if (txtName.Text != "" && txtDateFrom.Text.Trim() != "" && txtDateTo.Text.Trim() != "")
         {
             string sql = @"select top(50)TypeOfOperation as نوع_العملية,Amount as المبلغ,DateOfOperation تاريخ_العملية from TransactionOfTreasure where DateOfOperation between '" + txtDateFrom.Text + "' and '" + txtDateTo.Text + "' and TypeOfOperation like '%" + txtName.Text + "%' order by DateOfOperation desc";
             grdSelect.DataSource = DataObj.Selectdatatable(sql);
             grdSelect.DataBind();
         }
         else if (txtDateFrom.Text.Trim() != "" && txtDateTo.Text.Trim() != "")
         {
             string sql = @"select top(50)TypeOfOperation as نوع_العملية,Amount as المبلغ,DateOfOperation تاريخ_العملية from TransactionOfTreasure where DateOfOperation between '" + txtDateFrom.Text + "' and '" + txtDateTo.Text + "' order by DateOfOperation desc";
             grdSelect.DataSource = DataObj.Selectdatatable(sql);
             grdSelect.DataBind();
         }
         else
         {
             string sql = @"select top(50)TypeOfOperation as نوع_العملية,Amount as المبلغ,DateOfOperation تاريخ_العملية from TransactionOfTreasure order by DateOfOperation desc";
             grdSelect.DataSource = DataObj.Selectdatatable(sql);
             grdSelect.DataBind();
         }
     }
     catch (Exception ex)
     {
         DataObj.Alert(ex.Message, this);
     }
 }
Ejemplo n.º 29
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (drpName.SelectedIndex > 0)
            {
                div.Visible = true;
                string sql = @"ReportTranTreasure " + drpName.SelectedItem.Value + ",'" + DateTime.Parse(txtDateFrom.Text) + "','" + DateTime.Parse(txtDateTo.Text) + "'";
                System.Drawing.Printing.PrintDocument printDocument = new System.Drawing.Printing.PrintDocument();
                ReportDocument reportdocument = new ReportDocument();
                reportdocument.Load(Server.MapPath("Reports/ReportTranTreasure.rpt"));

                reportdocument.DataSourceConnections[0].SetConnection(".", "ERPsystem", true);
                reportdocument.SetDataSource(dataobj.Selectdatatable(sql));
                reportdocument.SetParameterValue("@userId", drpName.SelectedItem.Value);
                reportdocument.SetParameterValue("@datefrom", DateTime.Parse(txtDateFrom.Text));
                reportdocument.SetParameterValue("@dateto", DateTime.Parse(txtDateTo.Text));
                CrystalReportViewer1.ReportSource = reportdocument;
                //reportdocument.PrintOptions.PrinterName = printDocument.PrinterSettings.PrinterName;
                //reportdocument.PrintToPrinter(1, true, 1, 100);
            }
        }
        catch (Exception ex)
        {
            dataobj.Alert(ex.Message, this);
        }
    }
Ejemplo n.º 30
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         string Expense = @"INSERT INTO [dbo].[ComingMoney] ([Code],[Name],[DateOfComingMoney],[Amount],[User_Id],[Notes]) VALUES(@1,@2,@3,@4,@5,@6)";
         databaseaccesslayerobj.Execute(Expense, TxtCode.Text, TxtName.Text, DateTime.Parse(txtDate.Text), float.Parse(txtAmount.Text), Session["Id"], txtNotes.Text);
         string treasure = @"INSERT INTO [dbo].[TransactionOfTreasure] ([Code],[Amount],[TypeOfOperation],[DateOfOperation],[User_Id]) VALUES(@1,@2,@3,@4,@5)";
         databaseaccesslayerobj.Execute(treasure, TxtCode.Text, float.Parse(txtAmount.Text), "ايرادات", DateTime.Now, Session["Id"]);
         helper.cleartxt(UpdatePanel1);
         databaseaccesslayerobj.Alert("Success", this);
         CreateGuid();
     }
     catch (Exception ex)
     {
         databaseaccesslayerobj.Alert(ex.Message, this);
     }
 }