コード例 #1
0
        private void FormCostCenter_Load(object sender, EventArgs e)
        {
            try
            {
                _TypeOperation = ClassPublicVar.TypeOperation.Show;

                _ClassFillTree.FillTree(TreeViewMain, _ClassSelect.SelectOpration("TableCostCenter"), TableCostCenter.GroupID, TableCostCenter.ID, TableCostCenter.NameLng1, TableCostCenter.IsGroup);
                ToolsStatus();
                //if (IDNew != "")
                //{
                //    _ClassTreeViewController.SelectfromTree(ref TreeViewMain, IDNew);
                //}
                //else
                //{
                // استرجاع اول بيانات أول نود عند النقر على تعديل لتجنب بقاء مربعات النص فارغة
                TreeViewMain.SelectedNode = TreeViewMain.Nodes[0].FirstNode;
                //}
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #2
0
        private void ButtonSave_Click(object sender, EventArgs e)
        {
            try
            {
                string IDNew = "";
                if (TextBoxID.Text != "" && TextBoxID.Text != " ")
                {
                    // Add
                    if (_TypeOperation == ClassPublicVar.TypeOperation.Add)
                    {
                        if (TextBoxGroupID.Text != "" && TextBoxGroupID.Text != " ")
                        {
                            if (RadioBtnGroup.Checked)
                            {
                                _ClassInsert.InsertOpration(new string[] { TableCostCenter.ID, TableCostCenter.GroupID, TableCostCenter.GroupName, TableCostCenter.NameLng1
                                                                           , TableCostCenter.NameLng2, TableCostCenter.IsGroup }
                                                            , new string[] { TextBoxID.Text, TextBoxGroupID.Text, TextBoxGroupName.Text,
                                                                             TextBoxNameLng1.Text, TextBoxNameLng2.Text, "1" }
                                                            , "TableCostCenter"
                                                            , true
                                                            );
                            }

                            else if (RadioBtnNotGroup.Checked)
                            {
                                _ClassInsert.InsertOpration(new string[] { TableCostCenter.ID, TableCostCenter.GroupID, TableCostCenter.GroupName, TableCostCenter.NameLng1
                                                                           , TableCostCenter.NameLng2, TableCostCenter.IsGroup }
                                                            , new string[] { TextBoxID.Text, TextBoxGroupID.Text, TextBoxGroupName.Text,
                                                                             TextBoxNameLng1.Text, TextBoxNameLng2.Text, "0" }
                                                            , "TableCostCenter"
                                                            , true
                                                            );
                            }
                        }


                        else if (TextBoxGroupID.Text == "" || TextBoxGroupID.Text == " ")
                        {
                            _ClassInsert.InsertOpration(new string[] { TableCostCenter.ID, TableCostCenter.GroupID, TableCostCenter.GroupName, TableCostCenter.NameLng1
                                                                       , TableCostCenter.NameLng2, TableCostCenter.IsGroup }
                                                        , new string[] { TextBoxID.Text, "0", "Root",
                                                                         TextBoxNameLng1.Text, TextBoxNameLng2.Text, "0" }
                                                        , "TableCostCenter"
                                                        , true
                                                        );
                        }
                    }

                    // Edit
                    else if (_TypeOperation == ClassPublicVar.TypeOperation.Edit)
                    {
                        if (TextBoxGroupID.Text != "" && TextBoxGroupID.Text != " ")
                        {
                            if (RadioBtnGroup.Checked)
                            {
                                _ClassUpdate.UpdateOpration(new string[] { TableCostCenter.ID, TableCostCenter.GroupID, TableCostCenter.GroupName, TableCostCenter.NameLng1
                                                                           , TableCostCenter.NameLng2, TableCostCenter.IsGroup }
                                                            , new string[] { TextBoxID.Text, TextBoxGroupID.Text, TextBoxGroupName.Text,
                                                                             TextBoxNameLng1.Text, TextBoxNameLng2.Text, "1" }
                                                            , new string[] { TableCostCenter.ID }, new string[] { NodeID }
                                                            , "TableCostCenter", true);
                            }
                            else if (RadioBtnNotGroup.Checked)
                            {
                                _ClassUpdate.UpdateOpration(new string[] { TableCostCenter.ID, TableCostCenter.GroupID, TableCostCenter.GroupName, TableCostCenter.NameLng1
                                                                           , TableCostCenter.NameLng2, TableCostCenter.IsGroup }
                                                            , new string[] { TextBoxID.Text, TextBoxGroupID.Text, TextBoxGroupName.Text,
                                                                             TextBoxNameLng1.Text, TextBoxNameLng2.Text, "0" }
                                                            , new string[] { TableCostCenter.ID }, new string[] { NodeID }
                                                            , "TableCostCenter", true);
                            }
                        }

                        else if (TextBoxGroupID.Text == "" || TextBoxGroupID.Text == " ")
                        {
                            _ClassUpdate.UpdateOpration(new string[] { TableCostCenter.ID, TableCostCenter.GroupID, TableCostCenter.GroupName, TableCostCenter.NameLng1
                                                                       , TableCostCenter.NameLng2, TableCostCenter.IsGroup }
                                                        , new string[] { TextBoxID.Text, "0", "Root",
                                                                         TextBoxNameLng1.Text, TextBoxNameLng2.Text, "0" }
                                                        , new string[] { TableCostCenter.ID }, new string[] { NodeID }
                                                        , "TableCostCenter", true);
                        }
                    }

                    // عرض النود الجديد
                    IDNew = TextBoxID.Text;

                    _TypeOperation = ClassPublicVar.TypeOperation.Show;
                    _ClassFillTree.FillTree(TreeViewMain, _ClassSelect.SelectOpration("TableCostCenter"), TableCostCenter.GroupID, TableCostCenter.ID, TableCostCenter.NameLng1, TableCostCenter.IsGroup);
                    ToolsStatus();
                    _ClassTreeViewController.SelectfromTree(ref TreeViewMain, IDNew);

                    // FormCostCenter_Load(sender, e);
                    //_ClassFillTree.FillTree(TreeViewMain, _ClassSelect.SelectOpration("TableCostCenter"), TableCostCenter.GroupID, TableCostCenter.ID, TableCostCenter.NameLng1, TableCostCenter.IsGroup);
                }
                else
                {
                    MessageBox.Show("لم يتم إدخال رقم كود", "خطأ في الإدخال", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    TextBoxID.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #3
0
        private void ButtonSave_Click(object sender, EventArgs e)
        {
            try
            {
                string IDNew = "";
                if (TextBoxID.Text != "" && TextBoxID.Text != " ")
                {
                    if (_TypeOperation == ClassPublicVar.TypeOperation.Add)
                    {
                        if (TextBoxGroupID.Text != "" && TextBoxGroupID.Text != " ")
                        {
                            if (RadioBtnGroup.Checked)
                            {
                                _ClassInsert.InsertOpration(new string[] { TableCustomer.IDMain, TableCustomer.ID, TableCustomer.GroupID, TableCustomer.GroupName, TableCustomer.NameLng1, TableCustomer.NameLng2, TableCustomer.IsGroup,
                                                                           TableCustomer.Address, TableCustomer.City, TableCustomer.Email,
                                                                           TableCustomer.Telephone1, TableCustomer.Telephone2, TableCustomer.Fax, TableCustomer.Mobile,
                                                                           TableCustomer.CreditLimit, TableCustomer.DebitTrans, TableCustomer.CreditTrans, TableCustomer.Balance }
                                                            , new string[] { TextBoxMainID.Text, TextBoxID.Text, TextBoxGroupID.Text, TextBoxGroupName.Text, TextBoxNameLng1.Text, TextBoxNameLng2.Text, "1",
                                                                             TextBoxAddress.Text, TextBoxCity.Text, TextBoxEmail.Text,
                                                                             TextBoxTelephone1.Text, TextBoxTelephone2.Text, TextBoxFax.Text, TextBoxMobile.Text,
                                                                             TextBoxCreditLimit.Text, TextBoxDebitTrans.Text, TextBoxCreditTrans.Text, TextBoxBalance.Text }

                                                            , "TableCustomer"
                                                            , true
                                                            );
                            }

                            else if (RadioBtnNotGroup.Checked)
                            {
                                _ClassInsert.InsertOpration(new string[] { TableCustomer.IDMain, TableCustomer.ID, TableCustomer.GroupID, TableCustomer.GroupName, TableCustomer.NameLng1, TableCustomer.NameLng2, TableCustomer.IsGroup,
                                                                           TableCustomer.Address, TableCustomer.City, TableCustomer.Email,
                                                                           TableCustomer.Telephone1, TableCustomer.Telephone2, TableCustomer.Fax, TableCustomer.Mobile,
                                                                           TableCustomer.CreditLimit, TableCustomer.DebitTrans, TableCustomer.CreditTrans, TableCustomer.Balance }
                                                            , new string[] { TextBoxMainID.Text, TextBoxID.Text, TextBoxGroupID.Text, TextBoxGroupName.Text, TextBoxNameLng1.Text, TextBoxNameLng2.Text, "0",
                                                                             TextBoxAddress.Text, TextBoxCity.Text, TextBoxEmail.Text,
                                                                             TextBoxTelephone1.Text, TextBoxTelephone2.Text, TextBoxFax.Text, TextBoxMobile.Text,
                                                                             TextBoxCreditLimit.Text, TextBoxDebitTrans.Text, TextBoxCreditTrans.Text, TextBoxBalance.Text }
                                                            , "TableCustomer"
                                                            , true
                                                            );
                            }
                        }

                        else if (TextBoxGroupID.Text == "" || TextBoxGroupID.Text == " ")
                        {
                            _ClassInsert.InsertOpration(new string[] { TableCustomer.IDMain, TableCustomer.ID, TableCustomer.GroupID, TableCustomer.GroupName, TableCustomer.NameLng1, TableCustomer.NameLng2, TableCustomer.IsGroup,
                                                                       TableCustomer.Address, TableCustomer.City, TableCustomer.Email,
                                                                       TableCustomer.Telephone1, TableCustomer.Telephone2, TableCustomer.Fax, TableCustomer.Mobile,
                                                                       TableCustomer.CreditLimit, TableCustomer.DebitTrans, TableCustomer.CreditTrans, TableCustomer.Balance }
                                                        , new string[] { TextBoxMainID.Text, TextBoxID.Text, "0", "Root", TextBoxNameLng1.Text, TextBoxNameLng2.Text, "0",
                                                                         TextBoxAddress.Text, TextBoxCity.Text, TextBoxEmail.Text,
                                                                         TextBoxTelephone1.Text, TextBoxTelephone2.Text, TextBoxFax.Text, TextBoxMobile.Text,
                                                                         TextBoxCreditLimit.Text, TextBoxDebitTrans.Text, TextBoxCreditTrans.Text, TextBoxBalance.Text }
                                                        , "TableCustomer"
                                                        , true
                                                        );
                        }
                    }

                    else if (_TypeOperation == ClassPublicVar.TypeOperation.Edit)
                    {
                        if (TextBoxGroupID.Text != "" && TextBoxGroupID.Text != " ")
                        {
                            if (RadioBtnGroup.Checked)
                            {
                                _ClassUpdate.UpdateOpration(new string[] { TableCustomer.IDMain, TableCustomer.ID, TableCustomer.GroupID, TableCustomer.GroupName, TableCustomer.NameLng1, TableCustomer.NameLng2, TableCustomer.IsGroup,
                                                                           TableCustomer.Address, TableCustomer.City, TableCustomer.Email,
                                                                           TableCustomer.Telephone1, TableCustomer.Telephone2, TableCustomer.Fax, TableCustomer.Mobile,
                                                                           TableCustomer.CreditLimit, TableCustomer.DebitTrans, TableCustomer.CreditTrans, TableCustomer.Balance }
                                                            , new string[] { TextBoxMainID.Text, TextBoxID.Text, TextBoxGroupID.Text, TextBoxGroupName.Text, TextBoxNameLng1.Text, TextBoxNameLng2.Text, "1",
                                                                             TextBoxAddress.Text, TextBoxCity.Text, TextBoxEmail.Text,
                                                                             TextBoxTelephone1.Text, TextBoxTelephone2.Text, TextBoxFax.Text, TextBoxMobile.Text,
                                                                             TextBoxCreditLimit.Text, TextBoxDebitTrans.Text, TextBoxCreditTrans.Text, TextBoxBalance.Text }
                                                            , new string[] { TableCustomer.ID }, new string[] { NodeID }
                                                            , "TableCustomer", true);
                            }
                            else if (RadioBtnNotGroup.Checked)
                            {
                                _ClassUpdate.UpdateOpration(new string[] { TableCustomer.ID, TableCustomer.GroupID, TableCustomer.GroupName, TableCustomer.NameLng1, TableCustomer.NameLng2, TableCustomer.IsGroup,
                                                                           TableCustomer.Address, TableCustomer.City, TableCustomer.Email,
                                                                           TableCustomer.Telephone1, TableCustomer.Telephone2, TableCustomer.Fax, TableCustomer.Mobile,
                                                                           TableCustomer.CreditLimit, TableCustomer.DebitTrans, TableCustomer.CreditTrans, TableCustomer.Balance }
                                                            , new string[] { TextBoxMainID.Text, TextBoxID.Text, TextBoxGroupID.Text, TextBoxGroupName.Text, TextBoxNameLng1.Text, TextBoxNameLng2.Text, "0",
                                                                             TextBoxAddress.Text, TextBoxCity.Text, TextBoxEmail.Text,
                                                                             TextBoxTelephone1.Text, TextBoxTelephone2.Text, TextBoxFax.Text, TextBoxMobile.Text,
                                                                             TextBoxCreditLimit.Text, TextBoxDebitTrans.Text, TextBoxCreditTrans.Text, TextBoxBalance.Text }
                                                            , new string[] { TableCustomer.ID }, new string[] { NodeID }
                                                            , "TableCustomer", true);
                            }
                        }

                        else if (TextBoxGroupID.Text == "" || TextBoxGroupID.Text == " ")
                        {
                            _ClassUpdate.UpdateOpration(new string[] { TableCustomer.ID, TableCustomer.GroupID, TableCustomer.GroupName, TableCustomer.NameLng1, TableCustomer.NameLng2, TableCustomer.IsGroup,
                                                                       TableCustomer.Address, TableCustomer.City, TableCustomer.Email,
                                                                       TableCustomer.Telephone1, TableCustomer.Telephone2, TableCustomer.Fax, TableCustomer.Mobile,
                                                                       TableCustomer.CreditLimit, TableCustomer.DebitTrans, TableCustomer.CreditTrans, TableCustomer.Balance }
                                                        , new string[] { TextBoxMainID.Text, TextBoxID.Text, "0", "Root", TextBoxNameLng1.Text, TextBoxNameLng2.Text, "0",
                                                                         TextBoxAddress.Text, TextBoxCity.Text, TextBoxEmail.Text,
                                                                         TextBoxTelephone1.Text, TextBoxTelephone2.Text, TextBoxFax.Text, TextBoxMobile.Text,
                                                                         TextBoxCreditLimit.Text, TextBoxDebitTrans.Text, TextBoxCreditTrans.Text, TextBoxBalance.Text }
                                                        , new string[] { TableCustomer.ID }, new string[] { NodeID }
                                                        , "TableCustomer", true);
                        }
                    }
                    // عرض النود الجديد
                    IDNew          = TextBoxID.Text;
                    _TypeOperation = ClassPublicVar.TypeOperation.Show;

                    _ClassFillTree.FillTree(TreeViewMain, _ClassSelect.SelectOpration("TableCustomer"), TableCustomer.GroupID
                                            , TableCustomer.ID, TableCustomer.NameLng1, TableCustomer.IsGroup);

                    ToolsStatus();
                    _ClassTreeViewController.SelectfromTree(ref TreeViewMain, IDNew);
                    //FormCustomers_Load( sender, e);
                }
                else
                {
                    MessageBox.Show("لم يتم إدخال رقم كود", "خطأ في الإدخال", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    TextBoxID.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #4
0
        private void ButtonSave_Click(object sender, EventArgs e)
        {
            try
            {
                string IDNew = "";

                if (_TypeOperation == ClassPublicVar.TypeOperation.Add)
                {
                    if (TextBoxGroupID.Text != "" && TextBoxGroupID.Text != " ")
                    {
                        if (RadioBtnGroup.Checked)
                        {
                            _ClassInsert.InsertOpration(new string[] { TableBranches.MainID, TableBranches.ID, TableBranches.GroupID, TableBranches.GroupName, TableBranches.NameLng1
                                                                       , TableBranches.NameLng2, TableBranches.Phone, TableBranches.Fax, TableBranches.Address
                                                                       , TableBranches.RentStartDate, TableBranches.RentEndDate, TableBranches.CrNO
                                                                       , TableBranches.CrLssDate, TableBranches.CrExpDate, TableBranches.Municp
                                                                       , TableBranches.MunicpLssDate, TableBranches.MunicpExpDate, TableBranches.Advocatteship
                                                                       , TableBranches.AdvocatteshipLssDate, TableBranches.AdvocatteshipExpDate, TableBranches.IsGroup }

                                                        , new string[] { TextBoxMainID.Text, TextBoxID.Text, TextBoxGroupID.Text, TextBoxGroupName.Text, TextBoxNameLng1.Text, TextBoxNameLng2.Text
                                                                         , TextBoxPhone.Text, TextBoxeFax.Text, TextBoxAddress.Text, TextBoxRentStartDate.Text, TextBoxRentEndDate.Text
                                                                         , TextBoxCrNO.Text, TextBoxCrLssDate.Text, TextBoxCrExpDate.Text, TextBoxMunicp.Text, TextBoxMunicpLssDate.Text
                                                                         , TextBoxMunicpExpDate.Text, TxtBoxAdvocatteship.Text, TxtBoxAdvocatteshipLssDate.Text, TxtBoxAdvocatteshipExpDate.Text
                                                                         , "1" }
                                                        , "TableBranches"
                                                        , true
                                                        );
                        }

                        else if (RadioBtnNotGroup.Checked)
                        {
                            _ClassInsert.InsertOpration(new string[] { TableBranches.MainID, TableBranches.ID, TableBranches.GroupID, TableBranches.GroupName, TableBranches.NameLng1
                                                                       , TableBranches.NameLng2, TableBranches.Phone, TableBranches.Fax, TableBranches.Address
                                                                       , TableBranches.RentStartDate, TableBranches.RentEndDate, TableBranches.CrNO
                                                                       , TableBranches.CrLssDate, TableBranches.CrExpDate, TableBranches.Municp
                                                                       , TableBranches.MunicpLssDate, TableBranches.MunicpExpDate, TableBranches.Advocatteship
                                                                       , TableBranches.AdvocatteshipLssDate, TableBranches.AdvocatteshipExpDate, TableBranches.IsGroup }

                                                        , new string[] { TextBoxMainID.Text, TextBoxID.Text, TextBoxGroupID.Text, TextBoxGroupName.Text, TextBoxNameLng1.Text, TextBoxNameLng2.Text
                                                                         , TextBoxPhone.Text, TextBoxeFax.Text, TextBoxAddress.Text, TextBoxRentStartDate.Text, TextBoxRentEndDate.Text
                                                                         , TextBoxCrNO.Text, TextBoxCrLssDate.Text, TextBoxCrExpDate.Text, TextBoxMunicp.Text, TextBoxMunicpLssDate.Text
                                                                         , TextBoxMunicpExpDate.Text, TxtBoxAdvocatteship.Text, TxtBoxAdvocatteshipLssDate.Text, TxtBoxAdvocatteshipExpDate.Text
                                                                         , "0" }
                                                        , "TableBranches"
                                                        , true
                                                        );
                        }
                    }
                    else if (TextBoxGroupID.Text == "" || TextBoxGroupID.Text == " ")
                    {
                        _ClassInsert.InsertOpration(new string[] { TableBranches.MainID, TableBranches.ID, TableBranches.GroupID, TableBranches.GroupName, TableBranches.NameLng1
                                                                   , TableBranches.NameLng2, TableBranches.Phone, TableBranches.Fax, TableBranches.Address
                                                                   , TableBranches.RentStartDate, TableBranches.RentEndDate, TableBranches.CrNO
                                                                   , TableBranches.CrLssDate, TableBranches.CrExpDate, TableBranches.Municp
                                                                   , TableBranches.MunicpLssDate, TableBranches.MunicpExpDate, TableBranches.Advocatteship
                                                                   , TableBranches.AdvocatteshipLssDate, TableBranches.AdvocatteshipExpDate, TableBranches.IsGroup }

                                                    , new string[] { TextBoxMainID.Text, TextBoxID.Text, "0", "Root", TextBoxNameLng1.Text, TextBoxNameLng2.Text
                                                                     , TextBoxPhone.Text, TextBoxeFax.Text, TextBoxAddress.Text, TextBoxRentStartDate.Text, TextBoxRentEndDate.Text
                                                                     , TextBoxCrNO.Text, TextBoxCrLssDate.Text, TextBoxCrExpDate.Text, TextBoxMunicp.Text, TextBoxMunicpLssDate.Text
                                                                     , TextBoxMunicpExpDate.Text, TxtBoxAdvocatteship.Text, TxtBoxAdvocatteshipLssDate.Text, TxtBoxAdvocatteshipExpDate.Text
                                                                     , "0" }
                                                    , "TableBranches"
                                                    , true
                                                    );
                    }
                }
                else if (_TypeOperation == ClassPublicVar.TypeOperation.Edit)
                {
                    if (TextBoxGroupID.Text != "" && TextBoxGroupID.Text != " ")
                    {
                        if (RadioBtnGroup.Checked)
                        {
                            _ClassUpdate.UpdateOpration(new string[] { TableBranches.MainID, TableBranches.ID, TableBranches.GroupID, TableBranches.GroupName, TableBranches.NameLng1
                                                                       , TableBranches.NameLng2, TableBranches.Phone, TableBranches.Fax, TableBranches.Address
                                                                       , TableBranches.RentStartDate, TableBranches.RentEndDate, TableBranches.CrNO
                                                                       , TableBranches.CrLssDate, TableBranches.CrExpDate, TableBranches.Municp
                                                                       , TableBranches.MunicpLssDate, TableBranches.MunicpExpDate, TableBranches.Advocatteship
                                                                       , TableBranches.AdvocatteshipLssDate, TableBranches.AdvocatteshipExpDate, TableBranches.IsGroup }

                                                        , new string[] { TextBoxMainID.Text, TextBoxID.Text, TextBoxGroupID.Text, TextBoxGroupName.Text, TextBoxNameLng1.Text, TextBoxNameLng2.Text
                                                                         , TextBoxPhone.Text, TextBoxeFax.Text, TextBoxAddress.Text, TextBoxRentStartDate.Text, TextBoxRentEndDate.Text
                                                                         , TextBoxCrNO.Text, TextBoxCrLssDate.Text, TextBoxCrExpDate.Text, TextBoxMunicp.Text, TextBoxMunicpLssDate.Text
                                                                         , TextBoxMunicpExpDate.Text, TxtBoxAdvocatteship.Text, TxtBoxAdvocatteshipLssDate.Text, TxtBoxAdvocatteshipExpDate.Text
                                                                         , "1" }

                                                        , new string[] { TableBranches.ID }, new string[] { NodeID }
                                                        , "TableBranches", true);
                        }
                        else if (RadioBtnNotGroup.Checked)
                        {
                            _ClassUpdate.UpdateOpration(new string[] { TableBranches.MainID, TableBranches.ID, TableBranches.GroupID, TableBranches.GroupName, TableBranches.NameLng1
                                                                       , TableBranches.NameLng2, TableBranches.Phone, TableBranches.Fax, TableBranches.Address
                                                                       , TableBranches.RentStartDate, TableBranches.RentEndDate, TableBranches.CrNO
                                                                       , TableBranches.CrLssDate, TableBranches.CrExpDate, TableBranches.Municp
                                                                       , TableBranches.MunicpLssDate, TableBranches.MunicpExpDate, TableBranches.Advocatteship
                                                                       , TableBranches.AdvocatteshipLssDate, TableBranches.AdvocatteshipExpDate, TableBranches.IsGroup }

                                                        , new string[] { TextBoxMainID.Text, TextBoxID.Text, TextBoxGroupID.Text, TextBoxGroupName.Text, TextBoxNameLng1.Text, TextBoxNameLng2.Text
                                                                         , TextBoxPhone.Text, TextBoxeFax.Text, TextBoxAddress.Text, TextBoxRentStartDate.Text, TextBoxRentEndDate.Text
                                                                         , TextBoxCrNO.Text, TextBoxCrLssDate.Text, TextBoxCrExpDate.Text, TextBoxMunicp.Text, TextBoxMunicpLssDate.Text
                                                                         , TextBoxMunicpExpDate.Text, TxtBoxAdvocatteship.Text, TxtBoxAdvocatteshipLssDate.Text, TxtBoxAdvocatteshipExpDate.Text
                                                                         , "0" }

                                                        , new string[] { TableBranches.ID }, new string[] { NodeID }
                                                        , "TableBranches", true);
                        }
                    }
                    else if (TextBoxGroupID.Text == "" || TextBoxGroupID.Text == " ")
                    {
                        _ClassUpdate.UpdateOpration(new string[] { TableBranches.MainID, TableBranches.ID, TableBranches.GroupID, TableBranches.GroupName, TableBranches.NameLng1
                                                                   , TableBranches.NameLng2, TableBranches.Phone, TableBranches.Fax, TableBranches.Address
                                                                   , TableBranches.RentStartDate, TableBranches.RentEndDate, TableBranches.CrNO
                                                                   , TableBranches.CrLssDate, TableBranches.CrExpDate, TableBranches.Municp
                                                                   , TableBranches.MunicpLssDate, TableBranches.MunicpExpDate, TableBranches.Advocatteship
                                                                   , TableBranches.AdvocatteshipLssDate, TableBranches.AdvocatteshipExpDate, TableBranches.IsGroup }

                                                    , new string[] { TextBoxMainID.Text, TextBoxID.Text, "0", "Root", TextBoxNameLng1.Text, TextBoxNameLng2.Text
                                                                     , TextBoxPhone.Text, TextBoxeFax.Text, TextBoxAddress.Text, TextBoxRentStartDate.Text, TextBoxRentEndDate.Text
                                                                     , TextBoxCrNO.Text, TextBoxCrLssDate.Text, TextBoxCrExpDate.Text, TextBoxMunicp.Text, TextBoxMunicpLssDate.Text
                                                                     , TextBoxMunicpExpDate.Text, TxtBoxAdvocatteship.Text, TxtBoxAdvocatteshipLssDate.Text, TxtBoxAdvocatteshipExpDate.Text
                                                                     , "0" }

                                                    , new string[] { TableBranches.ID }, new string[] { NodeID }
                                                    , "TableBranches", true);
                    }
                }

                // عرض النود الجديد
                IDNew = TextBoxID.Text;

                _TypeOperation = ClassPublicVar.TypeOperation.Show;
                _ClassFillTree.FillTree(TreeViewMain, _ClassSelect.SelectOpration("TableBranches"), TableBranches.GroupID, TableBranches.ID, TableBranches.NameLng1, TableBranches.IsGroup);
                ToolsStatus();

                _ClassTreeViewController.SelectfromTree(ref TreeViewMain, IDNew);
                //FormBranches_Load(sender, e);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #5
0
        private void ButtonSave_Click(object sender, EventArgs e)
        {
            try
            {
                string IDNew = "";
                if (TextBoxID.Text != "" && TextBoxID.Text != " ")
                {
                    if (_TypeOperation == ClassPublicVar.TypeOperation.Add)
                    {
                        if (TextBoxGroupID.Text != "" && TextBoxGroupID.Text != " ")
                        {
                            if (RadioBtnGroup.Checked)
                            {
                                _ClassInsert.InsertOpration(new string[] { TableChatOfAccount.ID, TableChatOfAccount.GroupID, TableChatOfAccount.GroupName, TableChatOfAccount.NameLng1
                                                                           , TableChatOfAccount.NameLng2, TableChatOfAccount.Class, TableChatOfAccount.AccNaut
                                                                           , TableChatOfAccount.Status, TableChatOfAccount.TotalCredit, TableChatOfAccount.TotalDebit
                                                                           , TableChatOfAccount.Balacne, TableChatOfAccount.CreditLimit, TableChatOfAccount.Posting
                                                                           , TableChatOfAccount.IsGroup }

                                                            , new string[] { TextBoxID.Text, TextBoxGroupID.Text, TextBoxGroupName.Text, TextBoxNameLng1.Text, TextBoxNameLng2.Text
                                                                             , ComboBoxClass.Text, CompBoxAccNaut.Text, CompBoxStatus.Text, TextBoxTotalCredit.Text
                                                                             , TextBoxeTotalDebit.Text, TextBoxBalacne.Text, TextBoxCreditLimit.Text, CompBoxPosting.Text
                                                                             , "1" }
                                                            , "TableChatOfAccount"
                                                            , true
                                                            );
                            }

                            else if (RadioBtnNotGroup.Checked)
                            {
                                _ClassInsert.InsertOpration(new string[] { TableChatOfAccount.ID, TableChatOfAccount.GroupID, TableChatOfAccount.GroupName, TableChatOfAccount.NameLng1
                                                                           , TableChatOfAccount.NameLng2, TableChatOfAccount.Class, TableChatOfAccount.AccNaut
                                                                           , TableChatOfAccount.Status, TableChatOfAccount.TotalCredit, TableChatOfAccount.TotalDebit
                                                                           , TableChatOfAccount.Balacne, TableChatOfAccount.CreditLimit, TableChatOfAccount.Posting
                                                                           , TableChatOfAccount.IsGroup }

                                                            , new string[] { TextBoxID.Text, TextBoxGroupID.Text, TextBoxGroupName.Text, TextBoxNameLng1.Text, TextBoxNameLng2.Text
                                                                             , ComboBoxClass.Text, CompBoxAccNaut.Text, CompBoxStatus.Text, TextBoxTotalCredit.Text
                                                                             , TextBoxeTotalDebit.Text, TextBoxBalacne.Text, TextBoxCreditLimit.Text, CompBoxPosting.Text
                                                                             , "0" }
                                                            , "TableChatOfAccount"
                                                            , true
                                                            );
                            }
                        }
                        else if (TextBoxGroupID.Text == "" || TextBoxGroupID.Text == " ")
                        {
                            _ClassInsert.InsertOpration(new string[] { TableChatOfAccount.ID, TableChatOfAccount.GroupID, TableChatOfAccount.GroupName, TableChatOfAccount.NameLng1
                                                                       , TableChatOfAccount.NameLng2, TableChatOfAccount.Class, TableChatOfAccount.AccNaut
                                                                       , TableChatOfAccount.Status, TableChatOfAccount.TotalCredit, TableChatOfAccount.TotalDebit
                                                                       , TableChatOfAccount.Balacne, TableChatOfAccount.CreditLimit, TableChatOfAccount.Posting
                                                                       , TableChatOfAccount.IsGroup }

                                                        , new string[] { TextBoxID.Text, "0", "Root", TextBoxNameLng1.Text, TextBoxNameLng2.Text
                                                                         , ComboBoxClass.Text, CompBoxAccNaut.Text, CompBoxStatus.Text, TextBoxTotalCredit.Text
                                                                         , TextBoxeTotalDebit.Text, TextBoxBalacne.Text, TextBoxCreditLimit.Text, CompBoxPosting.Text
                                                                         , "0" }
                                                        , "TableChatOfAccount"
                                                        , true
                                                        );
                        }
                    }
                    else if (_TypeOperation == ClassPublicVar.TypeOperation.Edit)
                    {
                        if (TextBoxGroupID.Text != "" && TextBoxGroupID.Text != " ")
                        {
                            if (RadioBtnGroup.Checked)
                            {
                                _ClassUpdate.UpdateOpration(new string[]  { TableChatOfAccount.ID, TableChatOfAccount.GroupID, TableChatOfAccount.GroupName, TableChatOfAccount.NameLng1
                                                                            , TableChatOfAccount.NameLng2, TableChatOfAccount.Class, TableChatOfAccount.AccNaut
                                                                            , TableChatOfAccount.Status, TableChatOfAccount.TotalCredit, TableChatOfAccount.TotalDebit
                                                                            , TableChatOfAccount.Balacne, TableChatOfAccount.CreditLimit, TableChatOfAccount.Posting
                                                                            , TableChatOfAccount.IsGroup }
                                                            , new string[] { TextBoxID.Text, TextBoxGroupID.Text, TextBoxGroupName.Text, TextBoxNameLng1.Text, TextBoxNameLng2.Text
                                                                             , ComboBoxClass.Text, CompBoxAccNaut.Text, CompBoxStatus.Text, TextBoxTotalCredit.Text
                                                                             , TextBoxeTotalDebit.Text, TextBoxBalacne.Text, TextBoxCreditLimit.Text, CompBoxPosting.Text
                                                                             , "1" }
                                                            , new string[] { TableChatOfAccount.ID }, new string[] { NodeID }
                                                            , "TableChatOfAccount", true);
                            }
                            else if (RadioBtnNotGroup.Checked)
                            {
                                _ClassUpdate.UpdateOpration(new string[] { TableChatOfAccount.ID, TableChatOfAccount.GroupID, TableChatOfAccount.GroupName, TableChatOfAccount.NameLng1
                                                                           , TableChatOfAccount.NameLng2, TableChatOfAccount.Class, TableChatOfAccount.AccNaut
                                                                           , TableChatOfAccount.Status, TableChatOfAccount.TotalCredit, TableChatOfAccount.TotalDebit
                                                                           , TableChatOfAccount.Balacne, TableChatOfAccount.CreditLimit, TableChatOfAccount.Posting
                                                                           , TableChatOfAccount.IsGroup }
                                                            , new string[] { TextBoxID.Text, TextBoxGroupID.Text, TextBoxGroupName.Text, TextBoxNameLng1.Text, TextBoxNameLng2.Text
                                                                             , ComboBoxClass.Text, CompBoxAccNaut.Text, CompBoxStatus.Text, TextBoxTotalCredit.Text
                                                                             , TextBoxeTotalDebit.Text, TextBoxBalacne.Text, TextBoxCreditLimit.Text, CompBoxPosting.Text
                                                                             , "0" }
                                                            , new string[] { TableChatOfAccount.ID }, new string[] { NodeID }
                                                            , "TableChatOfAccount", true);
                            }
                        }

                        else if (TextBoxGroupID.Text == "" || TextBoxGroupID.Text == " ")
                        {
                            _ClassUpdate.UpdateOpration(new string[] { TableChatOfAccount.ID, TableChatOfAccount.GroupID, TableChatOfAccount.GroupName, TableChatOfAccount.NameLng1
                                                                       , TableChatOfAccount.NameLng2, TableChatOfAccount.Class, TableChatOfAccount.AccNaut
                                                                       , TableChatOfAccount.Status, TableChatOfAccount.TotalCredit, TableChatOfAccount.TotalDebit
                                                                       , TableChatOfAccount.Balacne, TableChatOfAccount.CreditLimit, TableChatOfAccount.Posting
                                                                       , TableChatOfAccount.IsGroup }
                                                        , new string[] { TextBoxID.Text, "0", "Root", TextBoxNameLng1.Text, TextBoxNameLng2.Text
                                                                         , ComboBoxClass.Text, CompBoxAccNaut.Text, CompBoxStatus.Text, TextBoxTotalCredit.Text
                                                                         , TextBoxeTotalDebit.Text, TextBoxBalacne.Text, TextBoxCreditLimit.Text, CompBoxPosting.Text
                                                                         , "0" }
                                                        , new string[] { TableChatOfAccount.ID }, new string[] { NodeID }
                                                        , "TableChatOfAccount", true);
                        }
                    }

                    // عرض النود الجديد
                    IDNew          = TextBoxID.Text;
                    _TypeOperation = ClassPublicVar.TypeOperation.Show;
                    _ClassFillTree.FillTree(TreeViewMain, _ClassSelect.SelectOpration("TableChatOfAccount"), TableChatOfAccount.GroupID, TableChatOfAccount.ID, TableChatOfAccount.NameLng1, TableChatOfAccount.IsGroup);
                    ToolsStatus();
                    _ClassTreeViewController.SelectfromTree(ref TreeViewMain, IDNew);

                    //FormChatOfAccount_Load(sender, e);
                }
                else
                {
                    MessageBox.Show("لم يتم إدخال رقم كود", "خطأ في الإدخال", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    TextBoxID.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }