private void SaveBtn_Click(object sender, EventArgs e)
        {
            #region "  CheckFillTextBox "
           

            if (SubActivitiesNameTextBox.Text == "")
            {

                SubActivitiesNameTextBox.TextBoxElement.Fill.BackColor = Color.OrangeRed;
                errorProvider1.SetError(this.SubActivitiesNameTextBox, "من فضلك ادخل اسم النشاط");

                SubActivitiesNameTextBox.Focus();

                return;
            }
            else
            {
                SubActivitiesNameTextBox.TextBoxElement.Fill.BackColor = Color.White;
                errorProvider1.Clear();
            }

            if (TotalCostTextBox.Text == "")
            {

                TotalCostTextBox.TextBoxElement.Fill.BackColor = Color.OrangeRed;
                errorProvider1.SetError(this.TotalCostTextBox, "من فضلك ادخل المبلغ");

                TotalCostTextBox.Focus();

                return;
            }
            else
            {
                TotalCostTextBox.TextBoxElement.Fill.BackColor = Color.White;
                errorProvider1.Clear();
            }
            #endregion

            if (RadMessageBox.Show(this, OperationX.SaveMessage, "حفظ التعديلات", MessageBoxButtons.YesNo, RadMessageIcon.Question) == DialogResult.Yes)
         {
             try
             {
                 Operation.BeginOperation(this);
             

                 ProjectSubActivity tb = new ProjectSubActivity()

                 {
                     ID = SubXid,
                    
                     SubActivityName = SubActivitiesNameTextBox.Text,
                     Description = SubActivitiesDescriptionTextBox.Text,
                     Startdate = StartDateTimePicker.Value.Date,
                     enddate = EndDateTimePicker.Value.Date,
                     TotalCost = Convert.ToDouble(TotalCostTextBox.Text),
                     Progress = int.Parse(ProgressEditor.Value.ToString()),
                     Status = StatusDropDownList.Text,
                     




                 };
                 SubActivityCmd.EditSubActivity(tb);

                 RadMessageBox.Show(OperationX.SaveMessagedone, "نجاح العملية", MessageBoxButtons.OK,RadMessageIcon.Info);

                 Operation.EndOperation(this);
                 GC.SuppressFinalize(tb);
                 GC.Collect();
                 GC.WaitForFullGCComplete();
                 GC.WaitForPendingFinalizers();
                 this.Dispose();
             }
             catch (Xprema.XpremaException ex)
             {
                 Operation.EndOperation(this);
                 RadMessageBox.Show(this, ex.OtherDescription, "خطأ", MessageBoxButtons.OK, RadMessageIcon.Error);
               
                
             }
         }
        }
        private void AddBtn_Click(object sender, EventArgs e)
        {

            #region "  CheckFillTextBox "
            //if (ActivitiesColumnComboBox.Text == "")
            //{

            //    ActivitiesColumnComboBox.MultiColumnComboBoxElement.BackColor = Color.OrangeRed;
            //    errorProvider1.SetError(this.ActivitiesColumnComboBox, "من فضلك ادخل النشاط الرئيسي");
            //    ActivitiesColumnComboBox.Focus();


            //    return;
            //}
            //else
            //{
            //    ActivitiesColumnComboBox.MultiColumnComboBoxElement.BackColor = Color.White;
            //    errorProvider1.Clear();
            //}
            //if (ActivitiesColumnComboBox.SelectedValue == null)
            //{

            //    ActivitiesColumnComboBox.MultiColumnComboBoxElement.BackColor = Color.OrangeRed;
            //    errorProvider1.SetError(this.ActivitiesColumnComboBox, "من فضلك ادخل النشاط الرئيسي");
            //    ActivitiesColumnComboBox.Focus();


            //    return;
            //}
            //else
            //{
            //    ActivitiesColumnComboBox.MultiColumnComboBoxElement.BackColor = Color.White;
            //    errorProvider1.Clear();
            //}

            if (SubActivitiesNameTextBox.Text == "")
            {

                SubActivitiesNameTextBox.TextBoxElement.Fill.BackColor = Color.OrangeRed;
                errorProvider1.SetError(this.SubActivitiesNameTextBox, "من فضلك ادخل اسم النشاط");

                SubActivitiesNameTextBox.Focus();

                return;
            }
            else
            {
                SubActivitiesNameTextBox.TextBoxElement.Fill.BackColor = Color.White;
                errorProvider1.Clear();
            }

            if (TotalCostTextBox.Text == "")
            {

                TotalCostTextBox.TextBoxElement.Fill.BackColor = Color.OrangeRed;
                errorProvider1.SetError(this.TotalCostTextBox, "من فضلك ادخل المبلغ");

                TotalCostTextBox.Focus();

                return;
            }
            else
            {
                TotalCostTextBox.TextBoxElement.Fill.BackColor = Color.White;
                errorProvider1.Clear();
            }
            #endregion


            Operation.BeginOperation(this);
           

            try
            {
                ProjectSubActivity tb = new ProjectSubActivity()
                {

                    ProjectActivity_ID = trActiv.ID,
                    SubActivityName = SubActivitiesNameTextBox.Text,
                    Description = SubActivitiesDescriptionTextBox.Text,
                    Startdate = DateTime.Parse(StartDateTimePicker.Value.ToString()),
                    enddate = DateTime.Parse(EndDateTimePicker.Value.Date.ToString()),
                    Status = "فعال",
                    Progress = 0,
                    TotalCost = Convert.ToDouble(TotalCostTextBox.Text),
                    ProjectProfile_ID = InformationsClass.ProjID,


                };
                SubActivityCmd.NewSubActivity(tb);
                Operation.EndOperation(this);
                Operation.ShowToustOk(OperationX.AddMessageDone, this);
                ClearTxt();
                GC.SuppressFinalize(tb);
                GC.Collect();
                GC.WaitForFullGCComplete();
                GC.WaitForPendingFinalizers();
            }
            catch (Xprema.XpremaException ex)
            {
                Operation.EndOperation(this);
                RadMessageBox.Show(this, ex.OtherDescription, "خطأ", MessageBoxButtons.OK, RadMessageIcon.Error);

            }

        }