private void BookCTLForm2_Load(object sender, EventArgs e) { BookNameLabel.Text = ((BookCTLForm)this.Owner).dataTable.Rows.Find(SelectedBOOK_ISBN)["BOOK_NAME"].ToString(); this.LendingPeriodUpDown.Value = decimal.Parse(((BookCTLForm)this.Owner).dataTable.Rows.Find(SelectedBOOK_ISBN)["BOOK_LENDINGPERIOD"].ToString()); this.LendingPeriodUpDown.TextAlign = HorizontalAlignment.Right; this.LendingPeriodUpDown.Maximum = this.LendingPeriodUpDown.Value; this.LendingPeriodUpDown.Minimum = 1; DataTable ds = ((BookCTLForm)this.Owner).sqlConnection.ReadEMPTable(); if (ds.Rows.Count <= 0) { MessageBox.Show("社員を登録してください", "編集", MessageBoxButtons.OK); this.Close(); return; } foreach (DataRow c in ds.Rows) { EmpComboBox.Items.Add(c["EMP_NAME"].ToString()); //コンボボックスの値に対応した社員コード表を作る emp_code.Add(c["EMP_CODE"].ToString()); } EmpComboBox.SelectedIndex = 0; EmpComboBox.DropDownStyle = ComboBoxStyle.DropDownList; EmpComboBox.Focus(); }
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; } #endregion var q = WorkCmd.CheckWork(int.Parse(EmpComboBox.SelectedValue.ToString()), radDateTimePicker1.Value.Date); if (q != null) { RadMessageBox.Show("مسجل في هذا التاريخ مسبقاً", "خطأ", MessageBoxButtons.OK, RadMessageIcon.Error); return; } float compMonth = (endtimeTimeEdit.Time.Minute + endtimeTimeEdit.Time.Hour * 60) - (startTimeTimeEdit.Time.Minute + startTimeTimeEdit.Time.Hour * 60); float Totaltime = compMonth / 60; WorkTime = Totaltime; Defernce = WorkTime - WorkHour; WorkTable tb = new WorkTable() { EmpId = int.Parse(EmpComboBox.SelectedValue.ToString()), WorkDate = radDateTimePicker1.Value.Date, startTime = startTimeTimeEdit.Time.TimeOfDay, endtime = endtimeTimeEdit.Time.TimeOfDay, RealWorkTimeNo = WorkHour, WorkTime = WorkTime, DefernceTime = Defernce, WorkFinsh = "true" }; WorkCmd.addWork(tb); RadMessageBox.Show("تمت عملية الحفظ", "تمت", MessageBoxButtons.OK, RadMessageIcon.Info); EmpComboBox.Focus(); }
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; } #endregion float compMonth = (endtimeTimeEdit.Time.Minute + endtimeTimeEdit.Time.Hour * 60) - (startTimeTimeEdit.Time.Minute + startTimeTimeEdit.Time.Hour * 60); float Totaltime = compMonth / 60; WorkTime = Totaltime; Defernce = WorkTime - WorkHour; if (RadMessageBox.Show(this, "هل تريد حفظ التعديلات", "حفظ", MessageBoxButtons.YesNo, RadMessageIcon.Question) == DialogResult.Yes) { Wtb.EmpId = int.Parse(EmpComboBox.SelectedValue.ToString()); Wtb.startTime = startTimeTimeEdit.Time.TimeOfDay; Wtb.endtime = endtimeTimeEdit.Time.TimeOfDay; Wtb.WorkTime = WorkTime; Wtb.RealWorkTimeNo = WorkHour; Wtb.DefernceTime = Defernce; Wtb.WorkFinsh = "true"; WorkCmd.EditWork(Wtb); } 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(); }
private void simpleButton1_Click(object sender, EventArgs e) { if (checkBox1.Checked == true && checkBox2.Checked == false) { #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; } #endregion this.Cursor = Cursors.WaitCursor; HoldyGridView.DataSource = HoldyCmd.GetByEmpID(int.Parse(EmpComboBox.SelectedValue.ToString())); GC.SuppressFinalize(HoldyCmd.GetByEmpID(int.Parse(EmpComboBox.SelectedValue.ToString()))); GC.Collect(); GC.WaitForFullGCComplete(); GC.WaitForPendingFinalizers(); this.Cursor = Cursors.Default; } if (checkBox1.Checked == false && checkBox2.Checked == true) { this.Cursor = Cursors.WaitCursor; HoldyGridView.DataSource = HoldyCmd.GetByDate(FromDateTimePicker.Value.Date, ToDateTimePicker.Value.Date); GC.SuppressFinalize(HoldyCmd.GetByDate(FromDateTimePicker.Value.Date, ToDateTimePicker.Value.Date)); GC.Collect(); GC.WaitForFullGCComplete(); GC.WaitForPendingFinalizers(); this.Cursor = Cursors.Default; } if (checkBox1.Checked == true && checkBox2.Checked == true) { #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; } #endregion this.Cursor = Cursors.WaitCursor; HoldyGridView.DataSource = HoldyCmd.GetByIDAndDate(int.Parse(EmpComboBox.SelectedValue.ToString()), FromDateTimePicker.Value.Date, ToDateTimePicker.Value.Date); GC.SuppressFinalize(HoldyCmd.GetByIDAndDate(int.Parse(EmpComboBox.SelectedValue.ToString()), FromDateTimePicker.Value.Date, ToDateTimePicker.Value.Date)); GC.Collect(); GC.WaitForFullGCComplete(); GC.WaitForPendingFinalizers(); this.Cursor = Cursors.Default; } }
private void simpleButton1_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 (radDropDownList1.Text == "") { radDropDownList1.BackColor = Color.OrangeRed; radDropDownList1.Focus(); return; } else { radDropDownList1.BackColor = Color.White; } #endregion var q = WorkCmd.CheckWork(int.Parse(EmpComboBox.SelectedValue.ToString()), LeaveDateTimePicker.Value.Date); if (q != null) { if (RadMessageBox.Show(this, "هل تريد حفظ التغيرات", "تنبيه", MessageBoxButtons.YesNo, RadMessageIcon.Question) == DialogResult.Yes) { LvTb.EmpId = int.Parse(EmpComboBox.SelectedValue.ToString()); LvTb.LeaveDate = LeaveDateTimePicker.Value.Date; LvTb.LeaveTime = leaveTimeTimeEdit.Time.TimeOfDay; LvTb.BackTime = backTimeTimeEdit.Time.TimeOfDay; LvTb.LeaveType = radDropDownList1.Text; LeaveCmdClass.EditLeave(LvTb); } if (RadMessageBox.Show(this, "هل يتم اعتماد ساعة العودة ساعة الانصراف", "تنبيه", MessageBoxButtons.YesNo, RadMessageIcon.Question) == DialogResult.Yes) { var ListData = WorkCmd.GetWorkInfo(int.Parse(EmpComboBox.SelectedValue.ToString()), LeaveDateTimePicker.Value.Date); foreach (var item in ListData) { Startime = DateTime.Parse(item.startTime.ToString()); UserClass.XWorkTime = float.Parse(item.RealWorkTimeNo.ToString()); } float compMonth = (backTimeTimeEdit.Time.Minute + backTimeTimeEdit.Time.Hour * 60) - (Startime.Minute + Startime.Hour * 60); float Totaltime = compMonth / 60; WorkTable tb1 = new WorkTable() { EmpId = int.Parse(EmpComboBox.SelectedValue.ToString()), WorkDate = LeaveDateTimePicker.Value.Date, startTime = Startime.TimeOfDay, endtime = leaveTimeTimeEdit.Time.TimeOfDay, RealWorkTimeNo = UserClass.XWorkTime, WorkTime = Totaltime, DefernceTime = (Totaltime - UserClass.XWorkTime), WorkFinsh = "true" }; WorkCmd.EditWorkUser(tb1); RadMessageBox.Show("تمت الاضافة واعتماد ساعة الانتهاء من الدوام", "تمت", MessageBoxButtons.OK, RadMessageIcon.Info); } RadMessageBox.Show("تمت الاضافة بدون اعتماد ساعةالانتهاء من الدوام", "تمت", MessageBoxButtons.OK, RadMessageIcon.Info); } else { RadMessageBox.Show("يرجى اولا تسجيل الحضور", "خطأ", MessageBoxButtons.OK, RadMessageIcon.Error); return; } }