public string ModifyOutPlanDays(T_HR_OUTPLANDAYS entRd) { using (OutPlanDaysBLL bllOutPlanDays = new OutPlanDaysBLL()) { return bllOutPlanDays.ModifyOutPlanDays(entRd); } }
private void SetWorkDayValue(CheckBox ck, ComboBox workComboHatfDay, T_HR_OUTPLANDAYS entTemp) { if (entTemp == null) { return; } ObservableCollection<T_HR_OUTPLANDAYS> entTemps = dgWorkDayList.ItemsSource as ObservableCollection<T_HR_OUTPLANDAYS>; foreach (T_HR_OUTPLANDAYS item in entTemps) { if (item.OUTPLANDAYID == entTemp.OUTPLANDAYID) { if (ck.IsChecked.Value == true) { item.ISHALFDAY = Convert.ToInt32(IsChecked.Yes).ToString(); item.ENDDATE = item.STARTDATE.Value.AddDays(1).AddMilliseconds(-1); item.DAYS =Convert.ToDecimal(0.5); if (workComboHatfDay.SelectedIndex == 0)//上午 { item.PEROID = "0"; } else { item.PEROID = "1"; } } else { item.ISHALFDAY = Convert.ToInt32(IsChecked.No).ToString(); } } } }
private void VacDayCheckHalfDay(CheckBox ck, DatePicker WorkdayEnddate , ComboBox ComboBoxHalfDay, NumericUpDown nudVacDays ,T_HR_OUTPLANDAYS obje) { if (ComboBoxHalfDay.SelectedIndex == -1) { ComboBoxHalfDay.SelectedIndex = 0; } if (ck.IsChecked.Value == true) { if (WorkdayEnddate != null) { WorkdayEnddate.Visibility = Visibility.Collapsed; } if (ComboBoxHalfDay != null) { ComboBoxHalfDay.Visibility = Visibility.Visible; } if (nudVacDays != null) { nudVacDays.Value = 0.5; } } else { if (WorkdayEnddate != null) { WorkdayEnddate.Visibility = Visibility.Visible; } if (ComboBoxHalfDay != null) { ComboBoxHalfDay.Visibility = Visibility.Collapsed; } CalculateDayCount(dgVacDayList); } SetVacDayValue(ck, ComboBoxHalfDay,obje); }
private void WorkDayCheckHalfDay(CheckBox ck, DatePicker WorkdayEnddate , ComboBox workComboHatfDay, NumericUpDown nudVacDays , T_HR_OUTPLANDAYS entTemp) { if (workComboHatfDay.SelectedIndex == -1) { workComboHatfDay.SelectedIndex = 0; } if (ck.IsChecked.Value) { if (WorkdayEnddate != null) { WorkdayEnddate.Visibility = Visibility.Collapsed; } if (workComboHatfDay != null) { workComboHatfDay.Visibility = Visibility.Visible; } if (nudVacDays != null) { nudVacDays.Value = 0.5; } } else { if (WorkdayEnddate != null) { WorkdayEnddate.Visibility = Visibility.Visible; } if (workComboHatfDay != null) { workComboHatfDay.Visibility = Visibility.Collapsed; } CalculateDayCount(dgWorkDayList); } SetWorkDayValue(ck, workComboHatfDay, entTemp); }
/// <summary> /// 添加新的列外日期记录(临时保存,不提交到数据库) /// </summary> /// <param name="dgList"></param> /// <param name="strDayType"></param> private void AddOutPlanDays(DataGrid dgList, string strDayType) { ObservableCollection<T_HR_OUTPLANDAYS> ents = new ObservableCollection<T_HR_OUTPLANDAYS>(); if (dgList.ItemsSource != null) { ents = dgList.ItemsSource as ObservableCollection<T_HR_OUTPLANDAYS>; } T_HR_OUTPLANDAYS entOutPlanDays = new T_HR_OUTPLANDAYS(); entOutPlanDays.OUTPLANDAYID = System.Guid.NewGuid().ToString().ToUpper(); entOutPlanDays.OUTPLANNAME = string.Empty; entOutPlanDays.DAYTYPE = strDayType; entOutPlanDays.STARTDATE = DateTime.Now; entOutPlanDays.ENDDATE = DateTime.Now; entOutPlanDays.DAYS = 1; entOutPlanDays.T_HR_VACATIONSET = entVacationSet; ents.Add(entOutPlanDays); dgList.ItemsSource = ents; }