private void saveBtn_Click(object sender, EventArgs e) { #region " CheckFillTextBox " if (DonorsComboBox.Text == "") { DonorsComboBox.MultiColumnComboBoxElement.BackColor = Color.OrangeRed; errorProvider1.SetError(this.DonorsComboBox, "من فضلك ادخل الممول"); DonorsComboBox.Focus(); return; } else { DonorsComboBox.MultiColumnComboBoxElement.BackColor = Color.White; errorProvider1.Clear(); } if (DonorsComboBox.SelectedValue == null) { DonorsComboBox.MultiColumnComboBoxElement.BackColor = Color.OrangeRed; errorProvider1.SetError(this.DonorsComboBox, "من فضلك ادخل الممول"); DonorsComboBox.Focus(); return; } else { DonorsComboBox.MultiColumnComboBoxElement.BackColor = Color.White; errorProvider1.Clear(); } if (CostTextBox.Text == "") { CostTextBox.TextBoxElement.Fill.BackColor = Color.OrangeRed; errorProvider1.SetError(this.CostTextBox, "من فضلك ادخل المبلغ"); CostTextBox.Focus(); return; } else { CostTextBox.TextBoxElement.Fill.BackColor = Color.White; errorProvider1.Clear(); } #endregion if (RadMessageBox.Show(this, OperationX.SaveMessage, "حفظ التعديلات", MessageBoxButtons.YesNo, RadMessageIcon.Question) == DialogResult.Yes) { Operation.BeginOperation(this); AmountsReceived tb = new AmountsReceived() { ID = XAmountID, TheDonorsProjectID = int.Parse(DonorsComboBox.SelectedValue.ToString()), Date = DateOfProecssPicker.Value.Date, Cost = Convert.ToDouble(CostTextBox.Text), }; AmountsReceivedsCmd.EditAmountsReceived(tb); Operation.EndOperation(this); RadMessageBox.Show(OperationX.SaveMessagedone, "نجاح العملية", MessageBoxButtons.OK, RadMessageIcon.Info); GC.SuppressFinalize(tb); GC.Collect(); GC.WaitForFullGCComplete(); GC.WaitForPendingFinalizers(); this.Dispose(); } }
private void AddBtn_Click(object sender, EventArgs e) { #region " CheckFillTextBox " if (DonorsComboBox.Text == "") { DonorsComboBox.MultiColumnComboBoxElement.BackColor = Color.OrangeRed; errorProvider1.SetError(this.DonorsComboBox, "من فضلك ادخل الممول"); DonorsComboBox.Focus(); return; } else { DonorsComboBox.MultiColumnComboBoxElement.BackColor = Color.White; errorProvider1.Clear(); } if (DonorsComboBox.SelectedValue == null) { DonorsComboBox.MultiColumnComboBoxElement.BackColor = Color.OrangeRed; errorProvider1.SetError(this.DonorsComboBox, "من فضلك ادخل الممول"); DonorsComboBox.Focus(); return; } else { DonorsComboBox.MultiColumnComboBoxElement.BackColor = Color.White; errorProvider1.Clear(); } if (CostTextBox.Text == "") { CostTextBox.TextBoxElement.Fill.BackColor = Color.OrangeRed; errorProvider1.SetError(this.CostTextBox, "من فضلك ادخل المبلغ"); CostTextBox.Focus(); return; } else { CostTextBox.TextBoxElement.Fill.BackColor = Color.White; errorProvider1.Clear(); } #endregion Operation.BeginOperation(this); AmountsReceived tb = new AmountsReceived() { ProjectProfile_ID=InformationsClass.ProjID, TheDonorsProjectID=int.Parse(DonorsComboBox.SelectedValue.ToString()), Date=DateOfProecssPicker.Value.Date, Cost=Convert.ToDouble(CostTextBox.Text), }; AmountsReceivedsCmd.NewAmountsReceived(tb); Operation.ShowToustOk(OperationX.AddMessageDone, this); Operation.EndOperation(this); Operation.ShowToustOk(OperationX.AddMessageDone, this); GC.SuppressFinalize(tb); GC.Collect(); GC.WaitForFullGCComplete(); GC.WaitForPendingFinalizers(); ClearTextBox(); }