Ejemplo n.º 1
0
 public DataRow get_account(string Account_ID)
 {
     try
     {
         return(dal.FindDataSet("select * from AC_Account where Account_ID=" + Account_ID).Rows[0]);
     }
     catch (Exception)
     {
         return(null);
     }
 }
Ejemplo n.º 2
0
        private void btn_search1_Click(object sender, EventArgs e)
        {
            dal = new DAL.DataAccessLayer();
            DataTable dt = new DataTable();

            dt = dal.FindDataSet("SELECT Account_ID , A_N , currency_Key , MIN_AMT , MAX_AMT , MIN_TRNS_AMT , MAX_TRNS_AMT , EXCEED_LMT , DR_CR , LMT_DESC , INACTIVE  FROM AC_Account_LMT where Account_ID between '" + txt_id_from.Text + "' and '" + txt_id_to.Text + "'");
            if (dt.Rows.Count > 0)
            {
                dgv_account_LMT.Rows.Clear();
                foreach (DataRow row in dt.Rows)
                {
                    dal = new DAL.DataAccessLayer();
                    int n = dgv_account_LMT.Rows.Add();
                    dgv_account_LMT.Rows[n].Cells[0].Value  = row["Account_ID"];
                    dgv_account_LMT.Rows[n].Cells[1].Value  = row["A_N"];
                    dgv_account_LMT.Rows[n].Cells[2].Value  = row["currency_Key"];
                    dgv_account_LMT.Rows[n].Cells[3].Value  = row["MIN_AMT"];
                    dgv_account_LMT.Rows[n].Cells[4].Value  = row["MAX_AMT"];
                    dgv_account_LMT.Rows[n].Cells[5].Value  = row["MIN_TRNS_AMT"];
                    dgv_account_LMT.Rows[n].Cells[6].Value  = row["MAX_TRNS_AMT"];
                    dgv_account_LMT.Rows[n].Cells[7].Value  = Convert.ToInt16(row["EXCEED_LMT"]);
                    dgv_account_LMT.Rows[n].Cells[8].Value  = Convert.ToInt16(row["DR_CR"]);
                    dgv_account_LMT.Rows[n].Cells[9].Value  = Convert.ToInt16(row["INACTIVE"]);
                    dgv_account_LMT.Rows[n].Cells[10].Value = row["LMT_DESC"];
                }
            }
        }
Ejemplo n.º 3
0
 private void btn_show_user_branch_Click(object sender, EventArgs e)
 {
     dal = new trader_app.DAL.DataAccessLayer();
     dgv_invantory_user.DataSource = null;
     dgv_invantory_user.DataSource = dal.FindDataSet("select A_U.User_ID as'رقم_المستخدم',A_U.User_Nema as 'اسم_المستخدم',I_U.Adds as 'تعديل_و_اضافة',I_U.Show as'عرض' from Ath_Users A_U left join [dbo].[Ath_Inventorys_Users] I_U  on A_U.User_ID=I_U.User_ID and I_U.Inventory_ID=" + txt_invantory_id2.Text);
     dal = null;
 }
Ejemplo n.º 4
0
 private void frm_Account_request_dgv_Load(object sender, EventArgs e)
 {
     DAL.DataAccessLayer dal = new DAL.DataAccessLayer();
     dgv_Account_request.DataSource       = dal.FindDataSet("select Account_ID as'رقم الحساب', Account_Parent_ID as'رقم الحساب الرئيسي ', A_N as الاسم  , E_N as 'الاسم الاجنبي ', Type_ID as 'النوع', Account_Group_ID as 'نوع المجموعه ', Class_ID as' نوع الصنف' , Note as 'الملاحظة ', by_user as 'المستخدم',add_status as 'الموافقه' from AC_Account_Request where add_status='0'");
     dgv_Account_request.Columns[0].Width = 100;
     dgv_Account_request.Columns[0].Name  = "رقم الحساب";
     dgv_Account_request.Columns[1].Width = 200;
     dgv_Account_request.Columns[1].Name  = "رقم الحساب الرئيسي";
     dgv_Account_request.Columns[2].Width = 70;
     dgv_Account_request.Columns[2].Name  = "الاسم";
     dgv_Account_request.Columns[3].Width = 100;
     dgv_Account_request.Columns[3].Name  = "الاسم الاجنبي";
     dgv_Account_request.Columns[4].Width = 70;
     dgv_Account_request.Columns[4].Name  = "النوع";
     dgv_Account_request.Columns[5].Width = 100;
     dgv_Account_request.Columns[5].Name  = "نوع المجموعه";
     dgv_Account_request.Columns[6].Width = 100;
     dgv_Account_request.Columns[6].Name  = "نوع الصنف";
     dgv_Account_request.Columns[7].Width = 70;
     dgv_Account_request.Columns[7].Name  = "الملاحظة";
     dgv_Account_request.Columns[8].Width = 70;
     dgv_Account_request.Columns[8].Name  = "المستخدم";
     dgv_Account_request.Columns[9].Width = 70;
     dgv_Account_request.Columns[9].Name  = "الموافقه";
 }
Ejemplo n.º 5
0
        private void btn_seve_Click(object sender, EventArgs e)
        {
            Account.P_AC_insert_Account_LMT(txt_Account_ID.Text, txt_A_N.Text, proc.Insert_com_to_db(cbx_currency), Convert.ToInt32(txt_MIN_AMT.Text), Convert.ToInt32(txt_MAX_AMT.Text), Convert.ToInt32(txt_MIN_TRNS_AMT.Text)
                                            , Convert.ToInt32(txt_MAX_TRNS_AMT.Text), Convert.ToBoolean(cbx_EXCEED_LMT.SelectedIndex)
                                            , Convert.ToBoolean(cbx_DR_CR.SelectedIndex), txt_LMT_DESC.Text, Convert.ToBoolean(cbx_INACTIVE.SelectedIndex));

            dal = new DAL.DataAccessLayer();
            DataTable dt = new DataTable();

            dt = dal.FindDataSet("SELECT Account_ID, A_N , currency_Key, MIN_AMT , MAX_AMT , MIN_TRNS_AMT , MAX_TRNS_AMT, EXCEED_LMT , DR_CR , LMT_DESC , INACTIVE  FROM AC_Account_LMT where Account_ID=" + txt_Account_ID.Text + "");
            if (dt.Rows.Count > 0)
            {
                dgv_account_LMT.Rows.Clear();
                foreach (DataRow row in dt.Rows)
                {
                    dal = new DAL.DataAccessLayer();
                    int n = dgv_account_LMT.Rows.Add();

                    dgv_account_LMT.Rows[n].Cells[0].Value  = row["Account_ID"];
                    dgv_account_LMT.Rows[n].Cells[1].Value  = row["A_N"];
                    dgv_account_LMT.Rows[n].Cells[2].Value  = row["currency_Key"];
                    dgv_account_LMT.Rows[n].Cells[3].Value  = row["MIN_AMT"];
                    dgv_account_LMT.Rows[n].Cells[4].Value  = row["MAX_AMT"];
                    dgv_account_LMT.Rows[n].Cells[5].Value  = row["MIN_TRNS_AMT"];
                    dgv_account_LMT.Rows[n].Cells[6].Value  = row["MAX_TRNS_AMT"];
                    dgv_account_LMT.Rows[n].Cells[7].Value  = Convert.ToInt16(row["EXCEED_LMT"]);
                    dgv_account_LMT.Rows[n].Cells[8].Value  = Convert.ToInt16(row["DR_CR"]);
                    dgv_account_LMT.Rows[n].Cells[9].Value  = Convert.ToInt16(row["INACTIVE"]);
                    dgv_account_LMT.Rows[n].Cells[10].Value = row["LMT_DESC"];
                }
            }
        }
Ejemplo n.º 6
0
 private void cbx_Account_type_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (cbx_Account_type.SelectedValue.ToString() != "1")
         {
             dal = new DAL.DataAccessLayer();
             dgv_Account_curr.DataSource       = dal.FindDataSet("select AM.currency_Key as الرمز,currency_name as الاسم,Ac.Used as استخدام from AC_Account_currency  AC right join AM_Currency AM  on ac.currency_Key=Am.currency_Key and Account_ID=N'" + txt_id.Text + "' where  AM.Used='1' ");
             dgv_Account_curr.Columns[0].Width = 30;
             dgv_Account_curr.Columns[0].Name  = "الرمز";
             dgv_Account_curr.Columns[1].Width = 70;
             dgv_Account_curr.Columns[1].Name  = "الاسم";
             dgv_Account_curr.Columns[2].Width = 60;
             dgv_Account_curr.Columns[2].Name  = "استخدام";
         }
         else
         {
             dgv_Account_curr.DataSource = null;
         }
     }
     catch (Exception)
     {
         return;
     }
 }
Ejemplo n.º 7
0
 private void btn_show_user_branch_Click(object sender, EventArgs e)
 {
     DAL = new trader_app.DAL.DataAccessLayer();
     dgv_Cash_user.DataSource = null;
     dgv_Cash_user.DataSource = DAL.FindDataSet("select A_U.[U_ID] as'رقم_المستخدم',A_U.[U_A_NAME] as 'اسم_المستخدم',B_U.Adds as 'تعديل_و_اضافة',B_U.Show as'عرض' from Ath_Users A_U left join Ath_Cash_In_Hand_User B_U on A_U.[U_ID]=B_U.User_ID and B_U.A_CODE=" + txt_A_CODE_2.Text);
     DAL = null;
 }
Ejemplo n.º 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (cbx_Inv_from.SelectedValue.ToString() != 0.ToString())
            {
                DataTable dt = new DataTable();
                dal = new DAL.DataAccessLayer();
                dgv_mov_line.Rows.Clear();
                // dt = dal.FindDataSet("select *from v_product_mov where type_ID=" + type_id + " and Movmant_ID=" + DB.select_Row(this.Tag.ToString(), "Movmant_num", txt_id.Text, "Documant_Type_ID", type_id + " and FYear=" + PL.main.Fyear)["ID"]);

                dt = dal.FindDataSet("select *from v_product_mov where" +
                                     " type_ID=" + 1.ToString() +
                                     " and receved =0" +
                                     " and  to_inv =" + cbx_Inv_from.SelectedValue.ToString() + " " +
                                     "and Movmant_ID=" + DB.select_Row(this.Tag.ToString(), "Movmant_num", txt_tran_Num.Text, "Documant_Type_ID", 1.ToString() + " and FYear=" + PL.main.Fyear)["ID"]);

                if (dt.Rows.Count > 0)
                {
                    cbx_inv_to.SelectedValue = dt.Rows[0]["from_inv"].ToString();
                    foreach (DataRow row in dt.Rows)
                    {
                        dal = new DAL.DataAccessLayer();
                        // if (row["Invontory_dis_ID"].ToString() == cbx_Inv_from.SelectedValue.ToString())

                        dgv_mov_line.Rows.Add(row["line_num"], row["product_ID"], row["A_N"], row["disc"], row["Units_ID"], row["Quantity_out"]);
                    }
                }
            }
            else
            {
                MessageBox.Show("اختار رقم الخزن").ToString();
            }
            // dgv_mov_line.DataSource = null;
        }
Ejemplo n.º 9
0
        private void view_data()
        {
            DB = new DAL.Databas_Class();
            DataRow cash_Info = DB.select_Row("AC_CASH_IN_HAND", "CASH_NO", txt_CASH_NO_id.Text);

            if (cash_Info != null)
            {
                txt_CASH_NO_id.Text           = cash_Info["CASH_NO"].ToString();
                txt_CASH_NAME_A_N.Text        = cash_Info["CASH_NAME"].ToString();
                txt_CASH_E_NAME_E_N.Text      = cash_Info["CASH_E_NAME"].ToString();
                txt_A_CODE.Text               = cash_Info["A_CODE"].ToString();
                txt_CASH_SR.Text              = cash_Info["CASH_SR"].ToString();
                txt_CASH_SR.Text              = cash_Info["CASH_SR"].ToString();
                cbx_CASH_TYPE.SelectedValue   = cash_Info["CASH_TYPE_id"].ToString();
                txt_INACTIVE_RES.Text         = cash_Info["INACTIVE_RES"].ToString();
                cbx_CONN_BRN_NO.SelectedValue = cash_Info["CONN_BRN_NO"].ToString();
                dtb_INACTIVE_DATE.Text        = cash_Info["INACTIVE_DATE"].ToString();

                if (cash_Info["INACTIVE"] != DBNull.Value)
                {
                    chbx_INACTIVE.Checked = Convert.ToBoolean(cash_Info["INACTIVE"]);
                }
                if (cash_Info["POS_SYS"] != DBNull.Value)
                {
                    chbx_POS_SYS.Checked = Convert.ToBoolean(cash_Info["POS_SYS"]);
                }

                //if (Account_Info["Class_ID"].ToString() != string.Empty)
                //    cbx_Account_Calss.SelectedValue = Account_Info["Class_ID"].ToString();
                //cbx_Account_group.SelectedValue = Account_Info["Account_Group_ID"].ToString();
                //cbx_Account_type.SelectedValue = Account_Info["Type_ID"].ToString();
                //Cbx_Account_status.SelectedValue = Account_Info["stutas"].ToString();
                //if (Account_Info["Account_Parent_ID"] == DBNull.Value)
                //{
                //    cbx_parent.SelectedIndex = -1;
                //    cbx_parent.SelectedValue = DBNull.Value;
                //}
                //else

                txt_in_date.Text         = cash_Info["in_date"].ToString();
                txt_edit_date.Text       = cash_Info["edit_date"].ToString();
                txt_edit_user.Text       = cash_Info["edit_user"].ToString();
                txt_by_user.Text         = cash_Info["by_user"].ToString();
                dgv_Cash_curr.DataSource = null;
                if (cash_Info["A_CODE"].ToString() != DBNull.Value.ToString())
                {
                    dal = new DAL.DataAccessLayer();
                    dgv_Cash_curr.DataSource       = dal.FindDataSet("select AM.currency_Key as الرمز,currency_name as الاسم,Ac.Used as استخدام from AC_Account_currency  AC right join AM_Currency AM  on ac.currency_Key=Am.currency_Key and Account_ID=N'" + txt_A_CODE.Text + "' where  AM.Used='1' ");
                    dgv_Cash_curr.Columns[0].Width = 30;
                    dgv_Cash_curr.Columns[0].Name  = "الرمز";
                    dgv_Cash_curr.Columns[1].Width = 70;
                    dgv_Cash_curr.Columns[1].Name  = "الاسم";
                    dgv_Cash_curr.Columns[2].Width = 60;
                    dgv_Cash_curr.Columns[2].Name  = "استخدام";
                }

                btn_edit.Enabled = true;
            }
        }
Ejemplo n.º 10
0
        public DataTable select_data_row(string T_N, string C_N, string ID)
        {
            dal = new DAL.DataAccessLayer();

            string sql = "select * from " + T_N + " where " + C_N + "=N'" + ID + "'";

            return(dal.FindDataSet(sql));
        }
Ejemplo n.º 11
0
        private void tree_refresh()
        {
            //  tv_Account.Nodes.Clear();
            dal = new DAL.DataAccessLayer();
            string sql = "SELECT   [Account_ID] ,[Account_Parent_ID] ,[A_N],[E_N] FROM [trader_db].[dbo].[AC_Account] where Account_ID<>0";

            // treeView1.Nodes.Add("taha");
            dt = dal.FindDataSet(sql);
            PopulateTreeView(0, tv_Account1.Nodes.Add("الدليل المحاسبي"));
        }
Ejemplo n.º 12
0
 public Boolean isselect_Row(string Tabel_Nema, string Column_Name, string ID)
 {
     DAL.DataAccessLayer dal = new DAL.DataAccessLayer();
     try
     {
         return(dal.FindDataSet("select * from " + Tabel_Nema + " where " + Column_Name + "=" + ID).Rows[0] != null);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Ejemplo n.º 13
0
 public string Available_Punch(string Invintory_num, string product_num, string Amount)
 {
     try
     {
         dal = new DAL.DataAccessLayer();
         return(dal.FindDataSet("select  COALESCE(sum(Available_Punch), 0 )/" + Amount + "  as Available_Punch from v_product_Available where Product_Parent_ID='" + product_num + "' and Invontory_ID =" + Invintory_num).Rows[0][0].ToString());
     }
     catch (Exception)
     {
         return("0");
     }
 }
Ejemplo n.º 14
0
        private void button1_Click(object sender, EventArgs e)
        {
            Dictionary <int, string> list_C_N = new Dictionary <int, string>();

            list_C_N.Add(50, "رقم الحساب");
            list_C_N.Add(100, "اسم الحساب ");
            list_C_N.Add(101, "الاسم الاجنبي ");

            string wherestr = " where Type_ID = 2 and ";
            string sql      = " SELECT  Account_ID ,A_N ,E_N  FROM   AC_Account ";

            PL.Am.Form_Search frm = new Am.Form_Search(sql, wherestr, list_C_N);
            frm.ShowDialog();

            // txt_A_CODE.Text = proc.max_num_in_Column("AC_Account where Account_Parent_ID  = " + frm.dataGridView1.CurrentRow.Cells[0].Value.ToString(), "Account_ID");
            txt_A_CODE.Text    = frm.dataGridView1.CurrentRow.Cells[0].Value.ToString();
            txt_Cash_name.Text = frm.dataGridView1.CurrentRow.Cells[1].Value.ToString();

            txt_A_CODE.ReadOnly = false;
            //  Account_ID = proc.max_num_in_Column("AC_Account", "Account_ID");
            //  MessageBox.Show("يرجا تحدد الحساب الرئسي ");
            txt_A_CODE.ReadOnly = true;
            btn_seve.Enabled    = true;

            //txt_CASH_NO_id.Text = frm.dataGridView1.CurrentRow.Cells[0].Value.ToString();

            //  s = lb_full_accout_num.Text;
            frm.Dispose();

            try
            {
                if (txt_A_CODE.TextLength != 0)
                {
                    dal = new DAL.DataAccessLayer();
                    dgv_Cash_curr.DataSource       = dal.FindDataSet("select AM.currency_Key as الرمز,currency_name as الاسم,Ac.Used as استخدام from AC_Account_currency  AC right join AM_Currency AM  on ac.currency_Key=Am.currency_Key and Account_ID=N'" + txt_A_CODE.Text + "' where  AM.Used='1' ");
                    dgv_Cash_curr.Columns[0].Width = 30;
                    dgv_Cash_curr.Columns[0].Name  = "الرمز";
                    dgv_Cash_curr.Columns[1].Width = 70;
                    dgv_Cash_curr.Columns[1].Name  = "الاسم";
                    dgv_Cash_curr.Columns[2].Width = 60;
                    dgv_Cash_curr.Columns[2].Name  = "استخدام";
                }
                else
                {
                    dgv_Cash_curr.DataSource = null;
                }
            }
            catch (Exception)
            {
                return;
            }
        }
Ejemplo n.º 15
0
 public DataRow select_Tabel_between_Date(string Tabel_Nema, string Column_Name, string from, string end)
 {
     DAL.DataAccessLayer dal = new DAL.DataAccessLayer();
     try
     {
         return(dal.FindDataSet("select * from " + Tabel_Nema + " where " + Column_Name + " between " + from + " and " + end).Rows[0]);
     }
     catch (Exception)
     {
         MessageBox.Show("التوجد بيانات في الفترة الحددة ");
         return(null);
     }
 }
Ejemplo n.º 16
0
 public DataTable select_Movment_peoduc(string product_ID)
 {
     DAL.DataAccessLayer dal = new DAL.DataAccessLayer();
     try
     {
         return(dal.FindDataSet("select Movmant_ID as 'رقم المستند',A_N 'نوع السند',MovementDate as 'التاريخ',from_inv as 'المخزن',Product_A_N as 'اسم المنتج',Quantity as 'الوارد',Quantity_out as 'المنصرف' ,Note as 'البيات' from v_product_mov where Product_ID=" + product_ID));
     }
     catch (Exception)
     {
         MessageBox.Show("التوجد بيانات للعرض ");
         return(null);
     }
 }
Ejemplo n.º 17
0
 public DataRow select_Row(string Tabel_Nema, string Column_Name, string ID, string Column_Name1, string ID1)
 {
     DAL.DataAccessLayer dal = new DAL.DataAccessLayer();
     try
     {
         return(dal.FindDataSet("select * from " + Tabel_Nema + " where " + Column_Name + " = " + ID + " and " + Column_Name1 + " = " + ID1).Rows[0]);
     }
     catch (Exception)
     {
         MessageBox.Show("ارجاء التاكد من رقم السجل قد ");
         return(null);
     }
 }
Ejemplo n.º 18
0
 public DataRow selec_inst_Row(string Tabel_Nema, string ID, string type)
 {
     DAL.DataAccessLayer dal = new DAL.DataAccessLayer();
     try
     {
         return(dal.FindDataSet("select * from " + Tabel_Nema + " where Fyear=" + PL.main.Fyear + " and Inst_num=" + ID + "and inst_type =" + type).Rows[0]);
     }
     catch (Exception)
     {
         MessageBox.Show("ارجاء التاكد من رقم السجل قد ");
         return(null);
     }
 }
Ejemplo n.º 19
0
        private void view_data()
        {
            DB = new DAL.Databas_Class();
            DataRow Account_Info = DB.select_Row("AC_Account", "Account_ID", txt_id.Text);

            // "[Employee_ID],[A_N] ,[E_N] ,[Management_ID] ,[Job]   ,[super_Employee_ID] ,[Hier_Date]  ,[Salary]   ,[Qualified_ID]  ,[Phone_num] ,[Phone_num_1]     ,[Out_Serves_Date]   ,[Email]  ,[Address] ,[Delegate_ID] ,[Stop]
            if (Account_Info != null)
            {
                txt_id.Text   = Account_Info["Account_ID"].ToString();
                txt_A_N.Text  = Account_Info["A_N"].ToString();
                txt_E_N.Text  = Account_Info["E_N"].ToString();
                txt_Note.Text = Account_Info["Note"].ToString();
                if (Account_Info["Class_ID"].ToString() != string.Empty)
                {
                    cbx_Account_Calss.SelectedValue = Account_Info["Class_ID"].ToString();
                }
                cbx_Account_group.SelectedValue  = Account_Info["Account_Group_ID"].ToString();
                cbx_Account_type.SelectedValue   = Account_Info["Type_ID"].ToString();
                Cbx_Account_status.SelectedValue = Account_Info["stutas"].ToString();
                if (Account_Info["Account_Parent_ID"] == DBNull.Value)
                {
                    cbx_parent.SelectedIndex = -1;
                    cbx_parent.SelectedValue = DBNull.Value;
                }
                else
                {
                    cbx_parent.SelectedValue = Account_Info["Account_Parent_ID"].ToString();
                }
                txt_in_date.Text            = Account_Info["in_date"].ToString();
                txt_edit_date.Text          = Account_Info["edit_date"].ToString();
                txt_edit_user.Text          = Account_Info["edit_user"].ToString();
                txt_by_user.Text            = Account_Info["by_user"].ToString();
                dgv_Account_curr.DataSource = null;

                if (Account_Info["Type_ID"].ToString() == "2")
                {
                    dal = new DAL.DataAccessLayer();
                    dgv_Account_curr.DataSource       = dal.FindDataSet("select AM.currency_Key as الرمز,currency_name as الاسم,Ac.Used as استخدام from AC_Account_currency  AC right join AM_Currency AM  on ac.currency_Key=Am.currency_Key and Account_ID=N'" + txt_id.Text + "' where  AM.Used='1' ");
                    dgv_Account_curr.Columns[0].Width = 30;
                    dgv_Account_curr.Columns[0].Name  = "الرمز";
                    dgv_Account_curr.Columns[1].Width = 70;
                    dgv_Account_curr.Columns[1].Name  = "الاسم";
                    dgv_Account_curr.Columns[2].Width = 60;
                    dgv_Account_curr.Columns[2].Name  = "استخدام";
                }

                btn_edit.Enabled = true;
            }
        }
Ejemplo n.º 20
0
        public DataTable select_Movment_peoduc(string product_ID, string from, string end, string Amount)
        {
            dal = new DAL.DataAccessLayer();
            //try
            //{
            return(dal.FindDataSet("select Inst_num as 'رقم المستند',D_A_N 'نوع السند',Instrument_Date as 'التاريخ',Invontory_ID as 'المخزن',A_N as 'اسم المنتج',Quantitys/" + Amount + " as 'الوارد',Quantitys_out/" + Amount + " as 'المنصرف' ,Note as 'البيات' from v_product_mov where Product_Parent_ID ='" + product_ID + "' and Instrument_Date between '" + from + "' and '" + end + "'"));


            //}
            //catch (Exception)
            //{
            //    MessageBox.Show("التوجد بيانات في الفترة الحددة ");
            //    return null;
            //}
        }
Ejemplo n.º 21
0
        private void view_data()
        {
            dt  = new DataTable();
            dal = new DAL.DataAccessLayer();
            dt  = dal.FindDataSet("SELECT  [Group_ID] ,[A_N] ,[E_N] ,[edit_date] ,[edit_user]  ,[in_date],[by_user] FROM [trader_db].[dbo].[AC_Account_Group] where Group_ID=" + txt_id.Text);

            if (dt.Rows.Count > 0)
            {
                txt_A_N.Text       = dt.Rows[0]["A_N"].ToString();
                txt_E_N.Text       = dt.Rows[0]["E_N"].ToString();
                txt_in_date.Text   = dt.Rows[0]["in_date"].ToString();
                txt_edit_date.Text = dt.Rows[0]["edit_date"].ToString();
                txt_edit_user.Text = dt.Rows[0]["edit_user"].ToString();
                txt_by_user.Text   = dt.Rows[0]["by_user"].ToString();
            }
        }
Ejemplo n.º 22
0
        private void cbx_VENDOR_GROUP_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                DataTable dt = pro.select_data_row("VENDOR_GROUP", "V_GROUP_CODE", Convert.ToUInt16(cbx_VENDOR_GROUP.SelectedValue.ToString()));
                txt_Account_ID.Text = dt.Rows[0]["V_ACCOUNT_ID"].ToString();
                dt.Dispose();
            }
            catch (Exception)
            {
                txt_Account_ID.Text = "";
            }
            try
            {
                DataTable dt = pro.select_data_row("AC_Account", "Account_ID", txt_Account_ID.Text);
                txt_A_N.Text = dt.Rows[0]["A_N"].ToString();
                dt.Dispose();
            }
            catch (Exception)
            {
                txt_A_N.Text = "";
            }

            try
            {
                if (txt_Account_ID.TextLength != 0)
                {
                    dal = new DAL.DataAccessLayer();
                    dgv_V_curr.DataSource       = dal.FindDataSet("select AM.currency_Key as الرمز,currency_name as الاسم,AC.Used as استخدام from AC_ACCOUNT_AN__CURR  AC right join AM_Currency AM  on ac.currency_Key=Am.currency_Key and ac.N_AN=N'" + txt_V_CODE.Text + "' where  AM.Used='1' ");
                    dgv_V_curr.Columns[0].Width = 100;
                    dgv_V_curr.Columns[0].Name  = "الرمز";
                    dgv_V_curr.Columns[1].Width = 130;
                    dgv_V_curr.Columns[1].Name  = "الاسم";
                    dgv_V_curr.Columns[2].Width = 130;
                    dgv_V_curr.Columns[2].Name  = "استخدام";
                    btn_seve.Enabled            = true;
                }
                else
                {
                    dgv_V_curr.DataSource = null;
                }
            }
            catch (Exception)
            {
                return;
            }
        }
Ejemplo n.º 23
0
        private void btn_add_Click(object sender, EventArgs e)
        {
            txt_E_N.Text = txt_A_N.Text = txt_by_user.Text = txt_edit_date.Text = txt_edit_user.Text = txt_in_date.Text = "";
            DAL.DataAccessLayer dal = new DAL.DataAccessLayer();
            DataTable           dt  = new DataTable();

            dt = dal.FindDataSet(" select V_CLASS from SUP_VENDOR_CLASS  ");

            if (dt.Rows.Count == 0)
            {
                txt_V_CLASS.Text = "1";
            }
            else
            {
                txt_V_CLASS.Text = proc.max_num_in_Column("SUP_VENDOR_CLASS", " V_CLASS");
            }
        }
Ejemplo n.º 24
0
        private void btn_add_Click(object sender, EventArgs e)
        {
            txt_E_N.Text = txt_A_N.Text = txt_by_user.Text = txt_edit_date.Text = txt_edit_user.Text = txt_in_date.Text = "";
            DAL.DataAccessLayer dal = new DAL.DataAccessLayer();
            DataTable           dt  = new DataTable();

            dt = dal.FindDataSet(" select PR_TYPE from IAS_PREQ_TYPES  ");

            if (dt.Rows.Count == 0)
            {
                txt_PR_TYPE.Text = "1";
            }
            else
            {
                txt_PR_TYPE.Text = proc.max_num_in_Column("IAS_PREQ_TYPES", " PR_TYPE");
            }
        }
Ejemplo n.º 25
0
        private void btn_add_Click(object sender, EventArgs e)
        {
            clear();
            DAL.DataAccessLayer dal = new DAL.DataAccessLayer();
            DataTable           dt  = new DataTable();

            dt = dal.FindDataSet(" select BANK_NO from AC_CASH_AT_BANK  ");

            if (dt.Rows.Count == 0)
            {
                txt_BANK_NO_id.Text = "1";
            }
            else
            {
                txt_BANK_NO_id.Text = proc.max_num_in_Column("AC_CASH_AT_BANK", "BANK_NO");
            }
        }
Ejemplo n.º 26
0
        private void btn_insert_to_dg_Click(object sender, EventArgs e)
        {
            dal = new DAL.DataAccessLayer();
            DataTable dt = new DataTable();

            dt = dal.FindDataSet("SELECT * FROM [trader_db].[dbo].[v_product_mov] where Inst_num =" + txt_tran_Num.Text + " and inst_type= " + cbx_insrt_form.SelectedValue.ToString() + " and FYear =" + PL.main.Fyear);
            if (dt.Rows.Count > 0)
            {
                dgv_mov_line.Rows.Clear();
                foreach (DataRow row in dt.Rows)
                {
                    dal = new DAL.DataAccessLayer();
                    // if (row["Invontory_dis_ID"].ToString() == cbx_Inv_from.SelectedValue.ToString())

                    dgv_mov_line.Rows.Add(row["line_num"], row["product_ID"], row["A_N"], row["disc"], row["Units_ID"], row["out_or_in"]);
                }
            }
        }
Ejemplo n.º 27
0
        private void search()
        {
            Dictionary <int, string> list_C_N = new Dictionary <int, string>();

            list_C_N.Add(50, "رقم الحساب");
            list_C_N.Add(100, "اسم الحساب ");
            list_C_N.Add(101, "الاسم الاجنبي ");

            string wherestr = " where Type_ID = 2 and ";
            string sql      = " SELECT  Account_ID ,A_N ,E_N  FROM   AC_Account ";

            PL.Am.Form_Search frm = new Am.Form_Search(sql, wherestr, list_C_N);
            frm.ShowDialog();


            txt_A_CODE.Text       = frm.dataGridView1.CurrentRow.Cells[0].Value.ToString();
            txt_AC_Bank_Name.Text = frm.dataGridView1.CurrentRow.Cells[1].Value.ToString();
            txt_A_CODE.ReadOnly   = true;
            btn_seve.Enabled      = true;
            frm.Dispose();

            try
            {
                if (txt_A_CODE.TextLength != 0)
                {
                    dal = new DAL.DataAccessLayer();
                    dgv_BANK_curr.DataSource       = dal.FindDataSet("select AM.currency_Key as الرمز,currency_name as الاسم,Ac.Used as استخدام from AC_Account_currency  AC right join AM_Currency AM  on ac.currency_Key=Am.currency_Key and Account_ID=N'" + txt_A_CODE.Text + "' where  AM.Used='1' ");
                    dgv_BANK_curr.Columns[0].Width = 30;
                    dgv_BANK_curr.Columns[0].Name  = "الرمز";
                    dgv_BANK_curr.Columns[1].Width = 70;
                    dgv_BANK_curr.Columns[1].Name  = "الاسم";
                    dgv_BANK_curr.Columns[2].Width = 60;
                    dgv_BANK_curr.Columns[2].Name  = "استخدام";
                }
                else
                {
                    dgv_BANK_curr.DataSource = null;
                }
            }
            catch (Exception)
            {
                return;
            }
        }
Ejemplo n.º 28
0
        private void btn_add_Click(object sender, EventArgs e)
        {
            clear();
            txt_CASH_NO_id.ReadOnly = true;
            txt_CASH_E_NAME_E_N.FindForm();
            DAL.DataAccessLayer dal = new DAL.DataAccessLayer();
            DataTable           dt  = new DataTable();

            dt = dal.FindDataSet(" select CASH_NO from AC_CASH_IN_HAND  ");

            if (dt.Rows.Count == 0)
            {
                txt_CASH_NO_id.Text = "1";
            }
            else
            {
                txt_CASH_NO_id.Text = proc.max_num_in_Column("AC_CASH_IN_HAND", "CASH_NO");
            }
        }
Ejemplo n.º 29
0
        private void btn_add_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrWhiteSpace(cbx_VENDOR_GROUP.SelectedValue.ToString()))
                {
                    MessageBox.Show("يرجا تحدد المجموعة الرئيسية ");
                    btn_seve.Enabled = false;
                }
                else
                {
                    txt_A_N.Text = "";
                }
            }
            catch
            {
                MessageBox.Show("يرجا تحدد المجموعة الرئيسية ");
                btn_seve.Enabled = false;
                cbx_VENDOR_GROUP.Focus();
            }
            DAL.DataAccessLayer dal = new DAL.DataAccessLayer();
            DataTable           dt  = new DataTable();

            dt = dal.FindDataSet(" select V_CODE from V_DETAILS  ");

            if (dt.Rows.Count == 0)
            {
                txt_V_CODE.Text = "1";
            }
            else
            {
                txt_V_CODE.Text = pro.max_num_in_Column("V_DETAILS", " V_CODE");
            }
            txt_V_CODE.ReadOnly              = true;
            txt_V_E_NAME.Text                = txt_A_N.Text = txt_Account_ID.Text = txt_by_user.Text = txt_edit_date.Text = txt_edit_user.Text = txt_in_date.Text = "";
            cbx_VENDOR_GROUP.SelectedIndex   = -1;
            cbx_Country.SelectedIndex        = -1;
            cbx_V_CLASS.SelectedIndex        = -1;
            cbx_V_DEGREE.SelectedIndex       = -1;
            cbx_Cost_Center_ID.SelectedIndex = -1;
        }
Ejemplo n.º 30
0
        private void view_data()
        {
            dt  = new DataTable();
            dal = new DAL.DataAccessLayer();
            dt  = dal.FindDataSet("SELECT  [Type_ID] ,[A_N] ,[E_N] ,[Affected_by_operations],[edit_date] ,[edit_user]  ,[in_date],[by_user] FROM [trader_db].[dbo].[AC_Account_type] where Type_ID=" + txt_id.Text);

            if (dt.Rows.Count > 0)
            {
                txt_A_N.Text = dt.Rows[0]["A_N"].ToString();
                txt_E_N.Text = dt.Rows[0]["E_N"].ToString();

                txt_in_date.Text   = dt.Rows[0]["in_date"].ToString();
                txt_edit_date.Text = dt.Rows[0]["edit_date"].ToString();
                txt_edit_user.Text = dt.Rows[0]["edit_user"].ToString();
                txt_by_user.Text   = dt.Rows[0]["by_user"].ToString();
                if (dt.Rows[0]["Affected_by_operations"] != DBNull.Value)
                {
                    chbx_Affected_by_operations.Checked = Convert.ToBoolean(dt.Rows[0]["Affected_by_operations"]);
                }
            }
        }