private void SaveBtn_Click(object sender, EventArgs e) { #region " CheckFillTextBox " if (HoldyTypeDropDownList.Text == "") { HoldyTypeDropDownList.BackColor = Color.OrangeRed; HoldyTypeDropDownList.Focus(); return; } else { HoldyTypeDropDownList.BackColor = Color.White; } #endregion HoldyTable tb = new HoldyTable { EmpID = UserClass.XEmpId, HoldyDate = holdyDateTimePicker.Value.Date, HoldType = HoldyTypeDropDownList.Text, }; HoldyCmd.addHoldy(tb); RadMessageBox.Show("تمت عملية الحفظ", "تمت", MessageBoxButtons.OK, RadMessageIcon.Info); Loginfrm myForm = (Loginfrm)Application.OpenForms["Loginfrm"]; myForm.Show(); this.Close(); }
private void SaveBtn_Click(object sender, EventArgs e) { #region " CheckFillTextBox " if (EmpComboBox.Text == "") { EmpComboBox.MultiColumnComboBoxElement.BackColor = Color.OrangeRed; EmpComboBox.Focus(); return; } else { EmpComboBox.MultiColumnComboBoxElement.BackColor = Color.White; } if (EmpComboBox.SelectedValue == null) { EmpComboBox.MultiColumnComboBoxElement.BackColor = Color.OrangeRed; EmpComboBox.Focus(); return; } else { EmpComboBox.MultiColumnComboBoxElement.BackColor = Color.White; } if (HoldyTypeDropDownList.Text == "") { HoldyTypeDropDownList.BackColor = Color.OrangeRed; HoldyTypeDropDownList.Focus(); return; } else { HoldyTypeDropDownList.BackColor = Color.White; } #endregion if (RadMessageBox.Show(this, "هل تريد حفظ التعديلات", "حفظ", MessageBoxButtons.YesNo, RadMessageIcon.Question) == DialogResult.Yes) { Htb.EmpID = int.Parse(EmpComboBox.SelectedValue.ToString()); Htb.HoldyDate = holdyDateTimePicker.Value.Date; Htb.HoldType = HoldyTypeDropDownList.Text; HoldyCmd.EditHoldy(Htb); RadMessageBox.Show("تمت عملية الحفظ", "تمت", MessageBoxButtons.OK, RadMessageIcon.Info); this.Close(); } }
private void AddBtn_Click(object sender, EventArgs e) { #region " CheckFillTextBox " if (EmpComboBox.Text == "") { EmpComboBox.MultiColumnComboBoxElement.BackColor = Color.OrangeRed; EmpComboBox.Focus(); return; } else { EmpComboBox.MultiColumnComboBoxElement.BackColor = Color.White; } if (EmpComboBox.SelectedValue == null) { EmpComboBox.MultiColumnComboBoxElement.BackColor = Color.OrangeRed; EmpComboBox.Focus(); return; } else { EmpComboBox.MultiColumnComboBoxElement.BackColor = Color.White; } if (HoldyTypeDropDownList.Text == "") { HoldyTypeDropDownList.BackColor = Color.OrangeRed; HoldyTypeDropDownList.Focus(); return; } else { HoldyTypeDropDownList.BackColor = Color.White; } #endregion var q = HoldyCmd.CheckHoldy(int.Parse(EmpComboBox.SelectedValue.ToString()), holdyDateTimePicker.Value.Date); if (q != null) { RadMessageBox.Show("مسجل في هذا التاريخ مسبقاً", "خطأ", MessageBoxButtons.OK, RadMessageIcon.Error); return; } HoldyTable tb = new HoldyTable() { EmpID = int.Parse(EmpComboBox.SelectedValue.ToString()), HoldyDate = holdyDateTimePicker.Value.Date, HoldType = HoldyTypeDropDownList.Text, }; HoldyCmd.addHoldy(tb); RadMessageBox.Show("تمت عملية الحفظ", "تمت", MessageBoxButtons.OK, RadMessageIcon.Info); EmpComboBox.Focus(); HoldyTypeDropDownList.ResetText(); }