예제 #1
0
        private void TextBoxGroupID_Leave(object sender, EventArgs e)
        {
            try
            {
                bool Exsists = false;
                if (_TypeOperation == ClassPublicVar.TypeOperation.Add)
                {
                    DTGroupID = _ClassSelect.SelectOpration(new string[] { TableTypeAcc.ID, TableTypeAcc.GroupName, TableTypeAcc.NameLng1, TableTypeAcc.IsGroup }, "TableTypeAcc");

                    if (TextBoxGroupID.Text == "")
                    {
                    }
                    else if (TextBoxGroupID.Text == "0")
                    {
                        TextBoxGroupID.Text   = "0";
                        TextBoxGroupName.Text = "Root";
                    }
                    else
                    {
                        foreach (DataRow row in DTGroupID.Rows)
                        {
                            if (row[TableTypeAcc.ID].ToString() == TextBoxGroupID.Text)
                            {
                                if (row[TableTypeAcc.IsGroup].ToString() == "0")
                                {
                                    MessageBox.Show("لا يمكن الإضافة لفرد");
                                    TextBoxGroupID.Focus();
                                    TextBoxGroupID.Clear();
                                    Exsists = true;
                                }

                                else
                                {
                                    TextBoxGroupID.Text   = row[TableTypeAcc.ID].ToString();
                                    TextBoxGroupName.Text = row[TableTypeAcc.NameLng1].ToString();
                                    TextBoxNameLng1.Focus();
                                    Exsists = true;
                                    break;
                                }
                            }
                        }


                        if (Exsists == false)
                        {
                            MessageBox.Show("غير موجود");
                            TextBoxGroupID.Clear();
                            DTGroupID.Clear();
                            TextBoxGroupID.Focus();
                            buttonGroupSearch_Click(sender, e);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #2
0
        private void TreeViewMain_AfterSelect(object sender, TreeViewEventArgs e)
        {
            //string NodeID = "";
            for (int i = 0; i < e.Node.Text.Length; i++)
            {
                if (e.Node.Text[i] == '>')
                {
                    i     += 2;
                    NodeID = e.Node.Text.Substring(i, e.Node.Text.Length - i);
                }
            }

            // تلوين النود عند اختيارها لتجنب اللون الاسود عند الاختيار
            _ClassFillTree.ColorTreeNode(TreeViewMain.Nodes[0]);


            try
            {
                dt = _ClassSelect.SelectOpration("TableCostCenter", new string[] { "ID" }, new string[] { NodeID });

                // عملنا الشرط لنحدد كيفية تعبئة مربعات النص حسب نوع العملية ( عرض و تعديل أو جديد )
                if (_TypeOperation == ClassPublicVar.TypeOperation.Show)
                {
                    TextBoxID.Text = dt.Rows[0][TableCostCenter.ID].ToString();

                    TextBoxGroupID.Text = dt.Rows[0][TableCostCenter.GroupID].ToString();

                    TextBoxGroupName.Text = dt.Rows[0][TableCostCenter.GroupName].ToString();

                    TextBoxNameLng1.Text = dt.Rows[0][TableCostCenter.NameLng1].ToString();

                    TextBoxNameLng2.Text = dt.Rows[0][TableCostCenter.NameLng2].ToString();

                    if (dt.Rows[0][TableCostCenter.IsGroup].ToString() == "0")
                    {
                        RadioBtnNotGroup.Checked = true;
                    }
                    else
                    {
                        RadioBtnGroup.Checked = true;
                    }
                }

                // عملنا الشرط لنحدد كيفية تعبئة مربعات النص حسب نوع العملية ( عرض و تعديل أو جديد )
                else if (_TypeOperation == ClassPublicVar.TypeOperation.Add)
                {
                    TextBoxGroupID.Text = dt.Rows[0][TableCostCenter.ID].ToString();

                    TextBoxGroupName.Text = dt.Rows[0][TableCostCenter.NameLng1].ToString();
                    TextBoxNameLng1.Focus();
                }
            }
            catch { }
        }
예제 #3
0
        //public void SearchGroupID(DataTable DTGroupID)
        //{

        //    foreach (DataRow row in DtID.Rows)
        //    {
        //        object sss = row[TableCostCenter.ID];
        //        if (sss = DBNull.Value)
        //        {
        //            MessageBox.Show("غير موجود");
        //            TextBoxID.Focus();
        //            break;
        //        }
        //    }
        //}

        private void ToolsStatus()
        {
            if (_TypeOperation == ClassPublicVar.TypeOperation.Show)
            {
                TextBoxID.ReadOnly        = true;
                TextBoxGroupID.ReadOnly   = true;
                TextBoxGroupName.ReadOnly = true;
                TextBoxNameLng1.ReadOnly  = true;
                TextBoxNameLng2.ReadOnly  = true;

                ButtonNew.Enabled         = true;
                ButtonEdit.Enabled        = true;
                ButtonSave.Enabled        = false;
                ButtonDelete.Enabled      = true;
                ButtonPrint.Enabled       = true;
                ButtonSearch.Enabled      = true;
                ButtonCancel.Enabled      = false;
                ButtonExit.Enabled        = true;
                TreeViewMain.Enabled      = true;
                RadioBtnGroup.Enabled     = false;
                RadioBtnNotGroup.Enabled  = false;
                buttonGroupSearch.Enabled = false;

                ButtonLast.Enabled     = true;
                ButtonNext.Enabled     = true;
                ButtonPrevious.Enabled = true;
                ButtonFirst.Enabled    = true;

                TextBoxID.Clear();
                TextBoxGroupID.Clear();
                TextBoxGroupName.Clear();
                TextBoxNameLng1.Clear();
                TextBoxNameLng2.Clear();
            }

            else if (_TypeOperation == ClassPublicVar.TypeOperation.Add)
            {
                TextBoxID.ReadOnly        = false;
                TextBoxGroupID.ReadOnly   = false;
                TextBoxGroupName.ReadOnly = true;
                TextBoxNameLng1.ReadOnly  = false;
                TextBoxNameLng2.ReadOnly  = false;
                RadioBtnNotGroup.Checked  = true;

                ButtonNew.Enabled         = true;
                ButtonEdit.Enabled        = false;
                ButtonSave.Enabled        = true;
                ButtonDelete.Enabled      = false;
                ButtonPrint.Enabled       = false;
                ButtonSearch.Enabled      = false;
                ButtonCancel.Enabled      = true;
                ButtonExit.Enabled        = false;
                RadioBtnGroup.Enabled     = true;
                RadioBtnNotGroup.Enabled  = true;
                buttonGroupSearch.Enabled = true;

                TreeViewMain.Enabled = false;

                ButtonLast.Enabled     = false;
                ButtonNext.Enabled     = false;
                ButtonPrevious.Enabled = false;
                ButtonFirst.Enabled    = false;

                TextBoxID.Clear();
                TextBoxGroupID.Clear();
                TextBoxGroupName.Clear();
                TextBoxNameLng1.Clear();
                TextBoxNameLng2.Clear();
            }

            else if (_TypeOperation == ClassPublicVar.TypeOperation.Edit)
            {
                TextBoxID.ReadOnly        = true;
                TextBoxGroupID.ReadOnly   = false;
                TextBoxGroupName.ReadOnly = true;
                TextBoxNameLng1.ReadOnly  = false;
                TextBoxNameLng2.ReadOnly  = false;

                ButtonNew.Enabled         = false;
                ButtonEdit.Enabled        = false;
                ButtonSave.Enabled        = true;
                ButtonDelete.Enabled      = false;
                ButtonPrint.Enabled       = false;
                ButtonSearch.Enabled      = false;
                ButtonCancel.Enabled      = true;
                ButtonExit.Enabled        = false;
                RadioBtnGroup.Enabled     = true;
                RadioBtnNotGroup.Enabled  = true;
                buttonGroupSearch.Enabled = true;

                TreeViewMain.Enabled = false;

                ButtonLast.Enabled     = false;
                ButtonNext.Enabled     = false;
                ButtonPrevious.Enabled = false;
                ButtonFirst.Enabled    = false;


                //TextBoxID.Clear();
                //TextBoxGroupID.Clear();
                //TextBoxGroupName.Clear();
                //TextBoxNameLng1.Clear();
                //TextBoxNameLng2.Clear();
            }
        }
예제 #4
0
        private void ToolsStatus()
        {
            if (_TypeOperation == ClassPublicVar.TypeOperation.Show)
            {
                TextBoxMainID.ReadOnly              = true;
                TextBoxMainName.ReadOnly            = true;
                TextBoxID.ReadOnly                  = true;
                TextBoxGroupID.ReadOnly             = true;
                TextBoxGroupName.ReadOnly           = true;
                TextBoxNameLng1.ReadOnly            = true;
                TextBoxNameLng2.ReadOnly            = true;
                TextBoxPhone.ReadOnly               = true;
                TextBoxeFax.ReadOnly                = true;
                TextBoxAddress.ReadOnly             = true;
                TextBoxRentStartDate.ReadOnly       = true;
                TextBoxRentEndDate.ReadOnly         = true;
                TextBoxCrNO.ReadOnly                = true;
                TextBoxCrLssDate.ReadOnly           = true;
                TextBoxCrExpDate.ReadOnly           = true;
                TextBoxMunicp.ReadOnly              = true;
                TextBoxMunicpLssDate.ReadOnly       = true;
                TextBoxMunicpExpDate.ReadOnly       = true;
                TxtBoxAdvocatteship.ReadOnly        = true;
                TxtBoxAdvocatteshipLssDate.ReadOnly = true;
                TxtBoxAdvocatteshipExpDate.ReadOnly = true;

                ButtonNew.Enabled    = true;
                ButtonEdit.Enabled   = true;
                ButtonSave.Enabled   = false;
                ButtonDelete.Enabled = true;
                ButtonPrint.Enabled  = true;
                ButtonSearch.Enabled = true;
                ButtonCancel.Enabled = false;
                ButtonExit.Enabled   = true;

                TreeViewMain.Enabled = true;

                RadioBtnGroup.Enabled     = false;
                RadioBtnNotGroup.Enabled  = false;
                buttonGroupSearch.Enabled = false;

                ButtonLast.Enabled     = true;
                ButtonNext.Enabled     = true;
                ButtonPrevious.Enabled = true;
                ButtonFirst.Enabled    = true;

                TextBoxMainID.Clear();
                TextBoxMainName.Clear();
                TextBoxID.Clear();
                TextBoxGroupID.Clear();
                TextBoxGroupName.Clear();
                TextBoxNameLng1.Clear();
                TextBoxNameLng2.Clear();
                TextBoxPhone.Clear();
                TextBoxeFax.Clear();
                TextBoxAddress.Clear();
                TextBoxRentStartDate.Clear();
                TextBoxRentEndDate.Clear();
                TextBoxCrNO.Clear();
                TextBoxCrLssDate.Clear();
                TextBoxCrExpDate.Clear();
                TextBoxMunicp.Clear();
                TextBoxMunicpLssDate.Clear();
                TextBoxMunicpExpDate.Clear();
                TxtBoxAdvocatteship.Clear();
                TxtBoxAdvocatteshipLssDate.Clear();
                TxtBoxAdvocatteshipExpDate.Clear();
            }

            else if (_TypeOperation == ClassPublicVar.TypeOperation.Add)
            {
                TextBoxMainID.ReadOnly              = false;
                TextBoxMainName.ReadOnly            = false;
                TextBoxID.ReadOnly                  = false;
                TextBoxGroupID.ReadOnly             = false;
                TextBoxGroupName.ReadOnly           = true;
                TextBoxNameLng1.ReadOnly            = false;
                TextBoxNameLng2.ReadOnly            = false;
                TextBoxPhone.ReadOnly               = false;
                TextBoxeFax.ReadOnly                = false;
                TextBoxAddress.ReadOnly             = false;
                TextBoxRentStartDate.ReadOnly       = false;
                TextBoxRentEndDate.ReadOnly         = false;
                TextBoxCrNO.ReadOnly                = false;
                TextBoxCrLssDate.ReadOnly           = false;
                TextBoxCrExpDate.ReadOnly           = false;
                TextBoxMunicp.ReadOnly              = false;
                TextBoxMunicpLssDate.ReadOnly       = false;
                TextBoxMunicpExpDate.ReadOnly       = false;
                TxtBoxAdvocatteship.ReadOnly        = false;
                TxtBoxAdvocatteshipLssDate.ReadOnly = false;
                TxtBoxAdvocatteshipExpDate.ReadOnly = false;

                RadioBtnNotGroup.Checked = true;

                ButtonNew.Enabled    = true;
                ButtonEdit.Enabled   = false;
                ButtonSave.Enabled   = true;
                ButtonDelete.Enabled = false;
                ButtonPrint.Enabled  = false;
                ButtonSearch.Enabled = false;
                ButtonCancel.Enabled = true;
                ButtonExit.Enabled   = false;

                TreeViewMain.Enabled = false;

                RadioBtnGroup.Enabled     = true;
                RadioBtnNotGroup.Enabled  = true;
                buttonGroupSearch.Enabled = true;

                ButtonLast.Enabled     = false;
                ButtonNext.Enabled     = false;
                ButtonPrevious.Enabled = false;
                ButtonFirst.Enabled    = false;

                TextBoxMainID.Clear();
                TextBoxMainName.Clear();
                TextBoxID.Clear();
                TextBoxGroupID.Clear();
                TextBoxGroupName.Clear();
                TextBoxNameLng1.Clear();
                TextBoxNameLng2.Clear();
                TextBoxPhone.Clear();
                TextBoxeFax.Clear();
                TextBoxAddress.Clear();
                TextBoxRentStartDate.Clear();
                TextBoxRentEndDate.Clear();
                TextBoxCrNO.Clear();
                TextBoxCrLssDate.Clear();
                TextBoxCrExpDate.Clear();
                TextBoxMunicp.Clear();
                TextBoxMunicpLssDate.Clear();
                TextBoxMunicpExpDate.Clear();
                TxtBoxAdvocatteship.Clear();
                TxtBoxAdvocatteshipLssDate.Clear();
                TxtBoxAdvocatteshipExpDate.Clear();
            }

            else if (_TypeOperation == ClassPublicVar.TypeOperation.Edit)
            {
                TextBoxMainID.ReadOnly              = false;
                TextBoxMainName.ReadOnly            = false;
                TextBoxID.ReadOnly                  = true;
                TextBoxGroupID.ReadOnly             = false;
                TextBoxGroupName.ReadOnly           = true;
                TextBoxNameLng1.ReadOnly            = false;
                TextBoxNameLng2.ReadOnly            = false;
                TextBoxPhone.ReadOnly               = false;
                TextBoxeFax.ReadOnly                = false;
                TextBoxAddress.ReadOnly             = false;
                TextBoxRentStartDate.ReadOnly       = false;
                TextBoxRentEndDate.ReadOnly         = false;
                TextBoxCrNO.ReadOnly                = false;
                TextBoxCrLssDate.ReadOnly           = false;
                TextBoxCrExpDate.ReadOnly           = false;
                TextBoxMunicp.ReadOnly              = false;
                TextBoxMunicpLssDate.ReadOnly       = false;
                TextBoxMunicpExpDate.ReadOnly       = false;
                TxtBoxAdvocatteship.ReadOnly        = false;
                TxtBoxAdvocatteshipLssDate.ReadOnly = false;
                TxtBoxAdvocatteshipExpDate.ReadOnly = false;

                ButtonNew.Enabled    = false;
                ButtonEdit.Enabled   = false;
                ButtonSave.Enabled   = true;
                ButtonDelete.Enabled = false;
                ButtonPrint.Enabled  = false;
                ButtonSearch.Enabled = false;
                ButtonCancel.Enabled = true;
                ButtonExit.Enabled   = false;

                TreeViewMain.Enabled = false;

                RadioBtnGroup.Enabled     = true;
                RadioBtnNotGroup.Enabled  = true;
                buttonGroupSearch.Enabled = true;

                ButtonLast.Enabled     = false;
                ButtonNext.Enabled     = false;
                ButtonPrevious.Enabled = false;
                ButtonFirst.Enabled    = false;

                //TextBoxMainID.Clear();
                //TextBoxMainName.Clear();
                //TextBoxID.Clear();
                //TextBoxGroupID.Clear();
                //TextBoxGroupName.Clear();
                //TextBoxNameLng1.Clear();
                //TextBoxNameLng2.Clear();
                //TextBoxPhone.Clear();
                //TextBoxeFax.Clear();
                //TextBoxAddress.Clear();
                //TextBoxRentStartDate.Clear();
                //TextBoxRentEndDate.Clear();
                //TextBoxCrNO.Clear();
                //TextBoxCrLssDate.Clear();
                //TextBoxCrExpDate.Clear();
                //TextBoxMunicp.Clear();
                //TextBoxMunicpLssDate.Clear();
                //TextBoxMunicpExpDate.Clear();
                //TxtBoxAdvocatteship.Clear();
                //TxtBoxAdvocatteshipLssDate.Clear();
                //TxtBoxAdvocatteshipExpDate.Clear();
            }
        }
예제 #5
0
        private void TreeViewMain_AfterSelect(object sender, TreeViewEventArgs e)
        {
            for (int i = 0; i < e.Node.Text.Length; i++)
            {
                if (e.Node.Text[i] == '>')
                {
                    i     += 2;
                    NodeID = e.Node.Text.Substring(i, e.Node.Text.Length - i);
                }
            }


            // تلوين النود عند اختيارها لتجنب اللون الاسود عند الاختيار
            _ClassFillTree.ColorTreeNode(TreeViewMain.Nodes[0]);
            dt = _ClassSelect.SelectOpration("TableBranches", new string[] { "ID" }, new string[] { NodeID });
            try
            {
                // عملنا الشرط لنحدد كيفية تعبئة مربعات النص حسب نوع العملية ( عرض و تعديل أو جديد )
                if (_TypeOperation == ClassPublicVar.TypeOperation.Show)
                {
                    TextBoxID.Text = dt.Rows[0][TableBranches.ID].ToString();

                    TextBoxGroupID.Text = dt.Rows[0][TableBranches.GroupID].ToString();

                    TextBoxGroupName.Text = dt.Rows[0][TableBranches.GroupName].ToString();

                    TextBoxNameLng1.Text = dt.Rows[0][TableBranches.NameLng1].ToString();

                    TextBoxNameLng2.Text = dt.Rows[0][TableBranches.NameLng2].ToString();

                    TextBoxPhone.Text = dt.Rows[0][TableBranches.Phone].ToString();

                    TextBoxeFax.Text = dt.Rows[0][TableBranches.Fax].ToString();

                    TextBoxAddress.Text = dt.Rows[0][TableBranches.Address].ToString();

                    TextBoxRentStartDate.Text = dt.Rows[0][TableBranches.RentStartDate].ToString();

                    TextBoxRentEndDate.Text = dt.Rows[0][TableBranches.RentEndDate].ToString();

                    TextBoxCrNO.Text = dt.Rows[0][TableBranches.CrNO].ToString();

                    TextBoxCrLssDate.Text = dt.Rows[0][TableBranches.CrLssDate].ToString();

                    TextBoxCrExpDate.Text = dt.Rows[0][TableBranches.CrExpDate].ToString();

                    TextBoxMunicp.Text = dt.Rows[0][TableBranches.Municp].ToString();

                    TextBoxMunicpLssDate.Text = dt.Rows[0][TableBranches.MunicpLssDate].ToString();

                    TextBoxMunicpExpDate.Text = dt.Rows[0][TableBranches.MunicpExpDate].ToString();

                    TxtBoxAdvocatteship.Text = dt.Rows[0][TableBranches.Advocatteship].ToString();

                    TxtBoxAdvocatteshipLssDate.Text = dt.Rows[0][TableBranches.AdvocatteshipLssDate].ToString();

                    TxtBoxAdvocatteshipExpDate.Text = dt.Rows[0][TableBranches.AdvocatteshipExpDate].ToString();

                    if (dt.Rows[0][TableBranches.IsGroup].ToString() == "0")
                    {
                        RadioBtnNotGroup.Checked = true;
                    }
                    else
                    {
                        RadioBtnGroup.Checked = true;
                    }
                }

                // عملنا الشرط لنحدد كيفية تعبئة مربعات النص حسب نوع العملية ( عرض و تعديل أو جديد )
                else if (_TypeOperation == ClassPublicVar.TypeOperation.Add)
                {
                    TextBoxGroupID.Text = dt.Rows[0][TableBranches.ID].ToString();

                    TextBoxGroupName.Text = dt.Rows[0][TableBranches.NameLng1].ToString();
                    TextBoxNameLng1.Focus();
                }
            }
            catch
            {
            }
        }
예제 #6
0
        private void ToolsStatus()
        {
            if (_TypeOperation == ClassPublicVar.TypeOperation.Show)
            {
                TextBoxID.ReadOnly          = true;
                TextBoxGroupID.ReadOnly     = true;
                TextBoxGroupName.ReadOnly   = true;
                TextBoxNameLng1.ReadOnly    = true;
                TextBoxNameLng2.ReadOnly    = true;
                TextBoxAddress.ReadOnly     = true;
                TextBoxCity.ReadOnly        = true;
                TextBoxEmail.ReadOnly       = true;
                TextBoxTelephone1.ReadOnly  = true;
                TextBoxTelephone2.ReadOnly  = true;
                TextBoxFax.ReadOnly         = true;
                TextBoxMobile.ReadOnly      = true;
                TextBoxCreditLimit.ReadOnly = true;
                TextBoxDebitTrans.ReadOnly  = true;
                TextBoxCreditTrans.ReadOnly = true;
                TextBoxBalance.ReadOnly     = true;


                ButtonNew.Enabled    = true;
                ButtonEdit.Enabled   = true;
                ButtonSave.Enabled   = false;
                ButtonDelete.Enabled = true;
                ButtonPrint.Enabled  = true;
                ButtonSearch.Enabled = true;
                ButtonCancel.Enabled = false;
                ButtonExit.Enabled   = true;

                TreeViewMain.Enabled      = true;
                RadioBtnGroup.Enabled     = false;
                RadioBtnNotGroup.Enabled  = false;
                buttonGroupSearch.Enabled = false;

                ButtonExit.Enabled     = true;
                ButtonLast.Enabled     = true;
                ButtonNext.Enabled     = true;
                ButtonPrevious.Enabled = true;
                ButtonFirst.Enabled    = true;

                TextBoxID.Clear();
                TextBoxGroupID.Clear();
                TextBoxGroupName.Clear();
                TextBoxNameLng1.Clear();
                TextBoxNameLng2.Clear();
                TextBoxAddress.Clear();
                TextBoxCity.Clear();
                TextBoxEmail.Clear();
                TextBoxTelephone1.Clear();
                TextBoxTelephone2.Clear();
                TextBoxFax.Clear();
                TextBoxMobile.Clear();
                TextBoxCreditLimit.Clear();
                TextBoxDebitTrans.Clear();
                TextBoxCreditTrans.Clear();
                TextBoxBalance.Clear();
            }

            else if (_TypeOperation == ClassPublicVar.TypeOperation.Add)
            {
                TextBoxID.ReadOnly          = false;
                TextBoxGroupID.ReadOnly     = false;
                TextBoxGroupName.ReadOnly   = true;
                TextBoxNameLng1.ReadOnly    = false;
                TextBoxNameLng2.ReadOnly    = false;
                TextBoxAddress.ReadOnly     = false;
                TextBoxCity.ReadOnly        = false;
                TextBoxEmail.ReadOnly       = false;
                TextBoxTelephone1.ReadOnly  = false;
                TextBoxTelephone2.ReadOnly  = false;
                TextBoxFax.ReadOnly         = false;
                TextBoxMobile.ReadOnly      = false;
                TextBoxCreditLimit.ReadOnly = false;
                TextBoxDebitTrans.ReadOnly  = false;
                TextBoxCreditTrans.ReadOnly = false;
                TextBoxBalance.ReadOnly     = false;


                ButtonNew.Enabled    = true;
                ButtonEdit.Enabled   = false;
                ButtonSave.Enabled   = true;
                ButtonDelete.Enabled = false;
                ButtonPrint.Enabled  = false;
                ButtonSearch.Enabled = false;
                ButtonCancel.Enabled = true;
                ButtonExit.Enabled   = false;

                TreeViewMain.Enabled      = false;
                RadioBtnGroup.Enabled     = true;
                RadioBtnNotGroup.Enabled  = true;
                buttonGroupSearch.Enabled = true;

                ButtonExit.Enabled     = false;
                ButtonLast.Enabled     = false;
                ButtonNext.Enabled     = false;
                ButtonPrevious.Enabled = false;
                ButtonFirst.Enabled    = false;

                TextBoxID.Clear();
                TextBoxGroupID.Clear();
                TextBoxGroupName.Clear();
                TextBoxNameLng1.Clear();
                TextBoxNameLng2.Clear();
                TextBoxAddress.Clear();
                TextBoxCity.Clear();
                TextBoxEmail.Clear();
                TextBoxTelephone1.Clear();
                TextBoxTelephone2.Clear();
                TextBoxFax.Clear();
                TextBoxMobile.Clear();
                TextBoxCreditLimit.Clear();
                TextBoxDebitTrans.Clear();
                TextBoxCreditTrans.Clear();
                TextBoxBalance.Clear();
            }

            else if (_TypeOperation == ClassPublicVar.TypeOperation.Edit)
            {
                TextBoxID.ReadOnly          = true;
                TextBoxGroupID.ReadOnly     = false;
                TextBoxGroupName.ReadOnly   = true;
                TextBoxNameLng1.ReadOnly    = false;
                TextBoxNameLng2.ReadOnly    = false;
                TextBoxAddress.ReadOnly     = false;
                TextBoxCity.ReadOnly        = false;
                TextBoxEmail.ReadOnly       = false;
                TextBoxTelephone1.ReadOnly  = false;
                TextBoxTelephone2.ReadOnly  = false;
                TextBoxFax.ReadOnly         = false;
                TextBoxMobile.ReadOnly      = false;
                TextBoxCreditLimit.ReadOnly = false;
                TextBoxDebitTrans.ReadOnly  = false;
                TextBoxCreditTrans.ReadOnly = false;
                TextBoxBalance.ReadOnly     = false;


                ButtonNew.Enabled    = true;
                ButtonEdit.Enabled   = false;
                ButtonSave.Enabled   = true;
                ButtonDelete.Enabled = false;
                ButtonPrint.Enabled  = false;
                ButtonSearch.Enabled = false;
                ButtonCancel.Enabled = true;
                ButtonExit.Enabled   = false;

                TreeViewMain.Enabled      = false;
                RadioBtnGroup.Enabled     = true;
                RadioBtnNotGroup.Enabled  = true;
                buttonGroupSearch.Enabled = true;

                ButtonLast.Enabled     = false;
                ButtonNext.Enabled     = false;
                ButtonPrevious.Enabled = false;
                ButtonFirst.Enabled    = false;

                //TextBoxID.Clear();
                //TextBoxGroupID.Clear();
                //TextBoxGroupName.Clear();
                //TextBoxNameLng1.Clear();
                //TextBoxNameLng2.Clear();
                //TextBoxAddress.Clear();
                //TextBoxCity.Clear();
                //TextBoxEmail.Clear();
                //TextBoxTelephone1.Clear();
                //TextBoxTelephone2.Clear();
                //TextBoxFax.Clear();
                //TextBoxMobile.Clear();
                //TextBoxCreditLimit.Clear();
                //TextBoxDebitTrans.Clear();
                //TextBoxCreditTrans.Clear();
                //TextBoxBalance.Clear();
            }
        }
예제 #7
0
        private void TreeViewMain_AfterSelect(object sender, TreeViewEventArgs e)
        {
            for (int i = 0; i < e.Node.Text.Length; i++)
            {
                if (e.Node.Text[i] == '>')
                {
                    i     += 2;
                    NodeID = e.Node.Text.Substring(i, e.Node.Text.Length - i);
                }
            }


            // تلوين النود عند اختيارها لتجنب اللون الاسود عند الاختيار
            _ClassFillTree.ColorTreeNode(TreeViewMain.Nodes[0]);


            dt = _ClassSelect.SelectOpration("TableCustomer", new string[] { TableCustomer.ID }, new string[] { NodeID });

            try
            {
                if (_TypeOperation == ClassPublicVar.TypeOperation.Show)
                {
                    TextBoxMainID.Text = dt.Rows[0][TableCustomer.IDMain].ToString();

                    TextBoxID.Text = dt.Rows[0][TableCustomer.ID].ToString();

                    TextBoxGroupID.Text = dt.Rows[0][TableCustomer.GroupID].ToString();

                    TextBoxGroupName.Text = dt.Rows[0][TableCustomer.GroupName].ToString();

                    TextBoxNameLng1.Text = dt.Rows[0][TableCustomer.NameLng1].ToString();

                    TextBoxNameLng2.Text = dt.Rows[0][TableCustomer.NameLng2].ToString();

                    TextBoxAddress.Text = dt.Rows[0][TableCustomer.Address].ToString();

                    TextBoxCity.Text = dt.Rows[0][TableCustomer.City].ToString();

                    TextBoxEmail.Text = dt.Rows[0][TableCustomer.Email].ToString();

                    TextBoxTelephone1.Text = dt.Rows[0][TableCustomer.Telephone1].ToString();

                    TextBoxTelephone2.Text = dt.Rows[0][TableCustomer.Telephone2].ToString();

                    TextBoxFax.Text = dt.Rows[0][TableCustomer.Fax].ToString();

                    TextBoxMobile.Text = dt.Rows[0][TableCustomer.Mobile].ToString();

                    TextBoxCreditLimit.Text = dt.Rows[0][TableCustomer.CreditLimit].ToString();

                    TextBoxDebitTrans.Text = dt.Rows[0][TableCustomer.DebitTrans].ToString();

                    TextBoxCreditTrans.Text = dt.Rows[0][TableCustomer.CreditTrans].ToString();

                    TextBoxBalance.Text = dt.Rows[0][TableCustomer.Balance].ToString();

                    if (dt.Rows[0][TableCustomer.IsGroup].ToString() == "0")
                    {
                        RadioBtnNotGroup.Checked = true;
                    }
                    else
                    {
                        RadioBtnGroup.Checked = true;
                    }
                }
                // عملنا الشرط لنحدد كيفية تعبئة مربعات النص حسب نوع العملية ( عرض و تعديل أو جديد )
                else if (_TypeOperation == ClassPublicVar.TypeOperation.Add)
                {
                    TextBoxGroupID.Text = dt.Rows[0][Tablecurency.ID].ToString();

                    TextBoxGroupName.Text = dt.Rows[0][Tablecurency.NameLng1].ToString();
                    TextBoxNameLng1.Focus();
                }
            }
            catch
            { }
        }
예제 #8
0
        private void TreeViewMain_AfterSelect(object sender, TreeViewEventArgs e)
        {
            for (int i = 0; i < e.Node.Text.Length; i++)
            {
                if (e.Node.Text[i] == '>')
                {
                    i     += 2;
                    NodeID = e.Node.Text.Substring(i, e.Node.Text.Length - i);
                }
            }


            // تلوين النود عند اختيارها لتجنب اللون الاسود عند الاختيار
            _ClassFillTree.ColorTreeNode(TreeViewMain.Nodes[0]);
            try
            {
                dt = _ClassSelect.SelectOpration("TableChatOfAccount", new string[] { TableChatOfAccount.ID }, new string[] { NodeID });

                if (_TypeOperation == ClassPublicVar.TypeOperation.Show)
                {
                    // TexBoxs
                    TextBoxID.Text = dt.Rows[0][TableChatOfAccount.ID].ToString();

                    TextBoxGroupID.Text = dt.Rows[0][TableChatOfAccount.GroupID].ToString();

                    TextBoxGroupName.Text = dt.Rows[0][TableChatOfAccount.GroupName].ToString();

                    TextBoxNameLng1.Text = dt.Rows[0][TableChatOfAccount.NameLng1].ToString();

                    TextBoxNameLng2.Text = dt.Rows[0][TableChatOfAccount.NameLng2].ToString();

                    TextBoxTotalCredit.Text = dt.Rows[0][TableChatOfAccount.TotalCredit].ToString();

                    TextBoxeTotalDebit.Text = dt.Rows[0][TableChatOfAccount.TotalDebit].ToString();

                    TextBoxBalacne.Text = dt.Rows[0][TableChatOfAccount.Balacne].ToString();

                    TextBoxCreditLimit.Text = dt.Rows[0][TableChatOfAccount.CreditLimit].ToString();

                    if (dt.Rows[0][TableChatOfAccount.IsGroup].ToString() == "0")
                    {
                        RadioBtnNotGroup.Checked = true;
                    }
                    else
                    {
                        RadioBtnGroup.Checked = true;
                    }

                    // comboboxs
                    ComboBoxClass.Text  = dt.Rows[0][TableChatOfAccount.Class].ToString();
                    CompBoxAccNaut.Text = dt.Rows[0][TableChatOfAccount.AccNaut].ToString();
                    CompBoxStatus.Text  = dt.Rows[0][TableChatOfAccount.Status].ToString();
                    CompBoxPosting.Text = dt.Rows[0][TableChatOfAccount.Posting].ToString();
                }
                // عملنا الشرط لنحدد كيفية تعبئة مربعات النص حسب نوع العملية ( عرض و تعديل أو جديد )
                else if (_TypeOperation == ClassPublicVar.TypeOperation.Add)
                {
                    TextBoxGroupID.Text = dt.Rows[0][TableCostCenter.ID].ToString();

                    TextBoxGroupName.Text = dt.Rows[0][TableCostCenter.NameLng1].ToString();
                    TextBoxNameLng1.Focus();
                }
            }
            catch
            {
            }
        }