private async Task LoadListTracks() { var list = await trackService.Get <List <MTrack> >(null); dgvAllTracks.ReadOnly = true; DGVHelper.PopulateWithList(dgvAllTracks, list, temp); }
private void btnGenerateDefaultRestDays_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.year_And_Month)) { ShowResult.show(lblResult, "请先选择月份!", false); timerRestoreTheLblResult.Enabled = true; return; } OracleParameter param_Name = new OracleParameter("v_Name", OracleDbType.NVarchar2, ParameterDirection.Input); OracleParameter param_YearAndMonth = new OracleParameter("v_yearAndMonth", OracleDbType.Varchar2, ParameterDirection.Input); OracleHelper oH = OracleHelper.getBaseDao(); string procedureName = "Generate_Rest_Day"; param_Name.Value = "everybody"; param_YearAndMonth.Value = this.year_And_Month; OracleParameter[] parameters = new OracleParameter[2] { param_Name, param_YearAndMonth }; int j = oH.ExecuteNonQuery(procedureName, parameters); if (j == 0) { ShowResult.show(lblResult, "Generate_Rest_Day:生成Rest_Day失败!", false); timerRestoreTheLblResult.Enabled = true; return; } this.dgv.DataSource = TheDaysOfOvertime.getRestDays(year_And_Month); DGVHelper.AutoSizeForDGV(dgv); }
/// <summary> /// 获取考勤记录。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnGetARResult_Click(object sender, EventArgs e) { V_Work_Schedule v_W_S = new V_Work_Schedule(); v_W_S.WORK_AND_REST_DATE = YearAndMonthStr; /* * if (!v_W_S.ifExistsWS()) { * return; * } */ ARResult aRResult = new ARResult(YearAndMonthStr); string randomStr = RandomStr.GetRandomString(40, true, true, true, false, ""); if (aRResult.updateARResult(randomStr) == 0) { this.dgv.DataSource = MESSAGES.getMSG(randomStr); DGVHelper.AutoSizeForDGV(dgv); ShowResult.show(lblResult, "异常!", false); timerRestoreTheLblResult.Enabled = true; return; } ShowResult.show(lblResult, "完成!", true); //显示结果 AttendanceR aR = new AttendanceR(); this.dgv.DataSource = aR.getARByYearAndMonth(aRResult.Year_And_Month_str); DGVHelper.AutoSizeForDGV(dgv); }
private System.Data.DataTable getSameNameInfo() { string sqlStr = string.Format(@"select distinct AR_Temp.Job_Number AS ""工号"", AR_Temp.name AS ""姓名"", AR_Temp.Attendance_Machine_Flag AS ""卡机编号"", AR_Temp.Row_Index AS ""行号"", AR_Temp.Record_Time AS ""记录时间"" from AR_Temp, ( select job_number, name, attendance_machine_flag, row_index, record_time from AR_Temp ) AR_T WHERE AR_Temp.name = AR_T.Name AND( (AR_Temp.Attendance_Machine_Flag = AR_T.attendance_machine_flag AND AR_Temp.Job_Number != AR_T.job_number) OR( AR_Temp.Attendance_Machine_Flag != AR_T.attendance_machine_flag ) ) order by NLSSORT(""姓名"", 'NLS_SORT= SCHINESE_PINYIN_M')"); System.Data.DataTable dt = OracleDaoHelper.getDTBySql(sqlStr); this.dgv_same_name.DataSource = dt; DGVHelper.AutoSizeForDGV(dgv_same_name); return(dt); }
/// <summary> /// 补卡 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnFillUpRecord_Click(object sender, EventArgs e) { v_fillUp.Day = day; v_fillUp.Time = time; int fillUpRecordTimes = v_fillUp.getFillUpRecordTimes(); if (fillUpRecordTimes >= 3) { ShowResult.show(lblResult, v_fillUp.Day.Substring(0, 7) + " " + v_fillUp.Name + " 已经补卡3次了。", false); timerRestoreTheLblResult.Start(); return; } string temp = string.Empty; if (v_fillUp.ifNotHaveRecordOfMorning() && !v_fillUp.ifNotHaveRecordOfAfternoon()) { temp = "上班卡"; } else if (!v_fillUp.ifNotHaveRecordOfMorning() && v_fillUp.ifNotHaveRecordOfAfternoon()) { temp = "下班卡"; } if (!v_fillUp.updateTheRecord()) { return; } this.dgv.DataSource = v_fillUp.getARRecordToFillUpByName(); DGVHelper.AutoSizeForDGV(dgv); ShowResult.show(lblResult, day + ": " + temp + " 已补!", true); timerRestoreTheLblResult.Start(); }
private void mCalendar_DateChanged(object sender, DateRangeEventArgs e) { this.year_And_Month = e.Start.ToString("yyyy-MM"); this.year_Month_Day = e.Start.ToString("yyyy-MM-dd"); this.dgv.DataSource = TheDaysOfOvertime.getRestDays(year_And_Month); DGVHelper.AutoSizeForDGV(dgv); }
private async void PlaylistUpsert_Load(object sender, EventArgs e) { await LoadListTracks(); if (ID.HasValue) { _playlist = await playlistService.GetById <MPlaylist>(ID.Value); txtName.Text = _playlist.Name; txtUser.Text = _playlist.User.Username; if (_playlist.Image.Length > 3) { pbPlaylistPicture.Image = ImageHelper.ByteArrayToSystemDrawing(_playlist.Image); pbPlaylistPicture.SizeMode = PictureBoxSizeMode.StretchImage; } playlistTracks = await playlistService.GetTracks <List <MTrack> >(ID.Value, null); LoadListPlaylistTracks(); } else { DGVHelper.PopulateWithList(dgvPlaylistTracks, playlistTracks, temp); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FrmProductsCostDetail_Load(object sender, EventArgs e) { IShowProductsCostDetail iShowProductsCostDetail = new ShowProductsCostDetailImpl(); this.dgv.DataSource = iShowProductsCostDetail.getProductsDetail(_pName); DGVHelper.AutoSizeForDGV(dgv); }
private void FrmRestDay_justConfiguration_Load(object sender, EventArgs e) { if (string.IsNullOrEmpty(_year_and_month)) { return; } /* * string procedureName = "PKG_Rest_Day.Generate_Rest_Day"; * * if (oH == null) * { * oH = OracleHelper.getBaseDao(); * } * OracleParameter param_Name = new OracleParameter("v_Name", OracleDbType.Varchar2, ParameterDirection.Input); * OracleParameter param_YearAndMonth = new OracleParameter("v_yearAndMonth", OracleDbType.NVarchar2, ParameterDirection.Input); * OracleParameter param_restDay_cur = new OracleParameter("v_cur", OracleDbType.RefCursor, ParameterDirection.ReturnValue); * OracleParameter[] parameters = new OracleParameter[3] { param_restDay_cur, param_Name, param_YearAndMonth }; * parameters[1].Value = "everybody"; * parameters[2].Value = _year_and_month; * DataTable dt = oH.getDT(procedureName, parameters); * this.dgv.DataSource = null; * this.dgv.DataSource = null; * this.dgv.DataSource = dt; * DGVHelper.AutoSizeForDGV(dgv); */ //先获取本月最后一天 int lastDay = 0; string sqlStr = string.Format(@"select to_char(last_day(to_date('{0}','yyyy-MM')),'dd') as last_day from dual", _year_and_month); DataTable dt = OracleDaoHelper.getDTBySql(sqlStr); lastDay = int.Parse(dt.Rows[0]["last_day"].ToString()); for (int i = 1; i <= lastDay; i++) { string year_and_month_str = _year_and_month + "-" + i.ToString(); sqlStr = string.Format(@"SELECT TO_Char(to_date('{0}','yyyy-MM-dd'),'day') the_day FROM DUAL ", year_and_month_str); dt = OracleDaoHelper.getDTBySql(sqlStr); if ("sunday".Equals(dt.Rows[0]["the_day"].ToString().Trim())) { sqlStr = string.Format(@"INSERT INTO Rest_Day(name,rest_day,update_time)values('everybody',to_date('{0}','yyyy-MM-dd'),sysdate)", year_and_month_str); OracleDaoHelper.executeSQL(sqlStr); } } //获取该月得所有休息日 sqlStr = string.Format(@"SELECT name as ""姓名"", rest_day as ""休息日"", update_time as ""更新时间"" FROM Rest_day WHERE trunc(rest_day,'MM') = to_date('{0}','yyyy-MM')", _year_and_month); dt = OracleDaoHelper.getDTBySql(sqlStr); this.dgv.DataSource = dt; DGVHelper.AutoSizeForDGV(dgv); }
private void btnSwitch_Click(object sender, EventArgs e) { if ("查看同名记录".Equals(btnSwitch.Text.Trim())) { btnSwitch.Text = "查看拼音相同的记录"; dgv_same_name.Visible = true; dgv_same_pinyin_of_name.Visible = false; string sqlStr = string.Format(@"select distinct AR_Temp.Job_Number AS ""工号"", AR_Temp.name AS ""姓名"", AR_Temp.Attendance_Machine_Flag AS ""卡机编号"", AR_Temp.Row_Index AS ""行号"", AR_Temp.Record_Time AS ""记录时间"" from AR_Temp, ( select job_number, name, attendance_machine_flag, row_index, record_time from AR_Temp ) AR_T WHERE AR_Temp.name = AR_T.Name AND( (AR_Temp.Attendance_Machine_Flag = AR_T.attendance_machine_flag AND AR_Temp.Job_Number != AR_T.job_number) OR( AR_Temp.Attendance_Machine_Flag != AR_T.attendance_machine_flag ) ) order by NLSSORT(""姓名"", 'NLS_SORT= SCHINESE_PINYIN_M')"); System.Data.DataTable dt = OracleDaoHelper.getDTBySql(sqlStr); this.dgv_same_name.DataSource = dt; DGVHelper.AutoSizeForDGV(dgv_same_name); } else { btnSwitch.Text = "查看同名记录"; string sqlStr = string.Format(@"select distinct AR_Temp.Job_Number AS ""工号"", AR_Temp.name AS ""姓名"", AR_Temp.Attendance_Machine_Flag AS ""卡机编号"", AR_Temp.Row_Index AS ""行号"", AR_Temp.Record_Time AS ""记录时间"" from AR_Temp, ( select distinct name from AR_Temp ) AR_T WHERE AR_Temp.name ! = AR_T.Name AND gethzpy.GetHzFullPY(AR_Temp.name) = gethzpy.GetHzFullPY(AR_T.name) order by NLSSORT(""姓名"", 'NLS_SORT= SCHINESE_PINYIN_M')"); System.Data.DataTable dt = OracleDaoHelper.getDTBySql(sqlStr); this.dgv_same_pinyin_of_name.DataSource = dt; dgv_same_pinyin_of_name.Visible = true; DGVHelper.AutoSizeForDGV(dgv_same_pinyin_of_name); dgv_same_name.Visible = false; } }
private void FrmAskForLeave_Load(object sender, EventArgs e) { tbNO.Text = ASK_For_Leave_Helper.getLastedNO(); this.dgv.DataSource = ASK_For_Leave_Helper.getAllVacationList(); DGVHelper.AutoSizeForDGV(dgv); dtStartPicker.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day); dtEndPicker.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day); timeStartPicker.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 8, 0, 0); timeEndPicker.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 17, 0, 0); }
private void LoadListPlaylistTracks() { var list = playlistTracks; if (list.Count > 0) { dgvPlaylistTracks.ColumnCount = 0; dgvPlaylistTracks.ReadOnly = true; DGVHelper.PopulateWithList(dgvPlaylistTracks, list, temp); } }
/// <summary> /// 生成工作安排表。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mCalendar_DateChanged(object sender, DateRangeEventArgs e) { startDateStr = e.Start.ToString("yyyy-MM-dd"); endDateStr = e.End.ToString("yyyy-MM-dd"); AttendanceR aR = new AttendanceR(); //获取相应的工作安排记录 System.Data.DataTable dt = aR.getARByRange(startDateStr, endDateStr); this.dgv.DataSource = dt; DGVHelper.AutoSizeForDGV(dgv); }
private void LoadListAlbumTracks() { var list = albumTracks; if (list.Count > 0) { dgvAlbumSongs.ColumnCount = 0; dgvAlbumSongs.ReadOnly = true; DGVHelper.PopulateWithList(dgvAlbumSongs, list, temp); } }
/// <summary> /// 删除该假条 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void delByNOToolStripMenuItem_Click(object sender, EventArgs e) { DataGridViewRow dgvR = dgv.CurrentRow; if (dgvR == null) { return; } string NO = dgvR.Cells["单号"].Value.ToString(); ASK_For_Leave_Helper.delTheNO(NO); this.dgv.DataSource = ASK_For_Leave_Helper.getAllVacationList(); DGVHelper.AutoSizeForDGV(dgv); }
private void btnAdd_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.year_Month_Day)) { ShowResult.show(lblResult, "请先选择具体日期", false); timerRestoreTheLblResult.Enabled = true; return; } TheDaysOfOvertime restDay = new TheDaysOfOvertime("everybody", year_Month_Day); restDay.addRestDay(); this.dgv.DataSource = TheDaysOfOvertime.getRestDays(year_And_Month); DGVHelper.AutoSizeForDGV(dgv); }
private void btnGenerateDefaultRestDays_Click(object sender, EventArgs e) { if (frmRestDay_justConfiguration == null || frmRestDay_justConfiguration.IsDisposed) { frmRestDay_justConfiguration = new FrmRestDay_justConfiguration(); } frmRestDay_justConfiguration.Year_and_month = year_And_Month; if (DialogResult.OK.Equals(frmRestDay_justConfiguration.ShowDialog())) { this.dgv.DataSource = TheDaysOfOvertime.getRestDays(year_And_Month); DGVHelper.AutoSizeForDGV(dgv); } ; }
/// <summary> /// 生成工作安排表。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mCalendar_DateChanged(object sender, DateRangeEventArgs e) { YearAndMonthStr = e.Start.ToString("yyyy-MM"); WorkSummary WS = new WorkSummary(YearAndMonthStr); V_Work_Schedule._YearAndMonthStr = YearAndMonthStr; //先生成工作计划安排 int affectedCount = WS.generateARSummary(); //获取相应的工作安排记录 System.Data.DataTable dt = WS.getARSummary(); this.dgv.DataSource = dt; DGVHelper.AutoSizeForDGV(dgv); }
/// <summary> /// 删除该行。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void delToolStripMenuItem_Click(object sender, EventArgs e) { DataGridViewRow dr = dgv.CurrentRow; if (dr == null) { return; } string line_name = dr.Cells["Line_Name"].Value.ToString(); LineInfo.delete(line_name); this.dgv.DataSource = LineInfo.getAllLineInfo(); DGVHelper.AutoSizeForDGV(dgv); }
private void loadAskForLeaveData() { string sqlStr = string.Format(@"select job_number as ""工号"", name as ""姓名"", to_char(leave_date,'yyyy-MM-dd') ""请假日期"", to_char(leave_start_time,'yyyy-MM-dd HH24:MI') ""起始时间"", to_char(leave_end_time,'yyyy-MM-dd HH24:MI') ""终止时间"" from Ask_For_Leave where name = '{0}' order by leave_date asc", cbName.Text.Trim()); DataTable dt = OracleDaoHelper.getDTBySql(sqlStr); this.dgv.DataSource = dt; DGVHelper.AutoSizeForDGV(dgv); }
/// <summary> /// 获取当前Product_Name的成本详情。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cbPN_SelectedIndexChanged(object sender, EventArgs e) { if (string.IsNullOrEmpty(cbPN.Text.Trim())) { return; } IShowProductsCostSummary iShowProductsCostSummary = new ShowProductsCostSummaryImpl(); System.Data.DataTable dt = iShowProductsCostSummary.get_P_C_Summary_To_Export(cbPN.Text.Trim()); this.dgv.DataSource = dt; DGVHelper.AutoSizeForDGV(dgv); //dgv.Columns["Seq"].Visible = false; //显示照片 FrmProductsCostSummary.getPictureByProductName(cbPN.Text.Trim(), pictureBox); }
private void btnQuery_Click(object sender, EventArgs e) { //获取姓名。 string name = cbName.Text.Trim(); if (name.Length == 0) { return; } string sqlStr = string.Format(@"select start_date AS ""起始时间"", end_date AS ""终止时间"", tabulation_time AS ""制表时间"", fingerprint_date AS ""按指纹日期"", job_number AS ""工号"", name AS ""姓名"", dept AS ""部门"", to_char(fpt_first_time,'HH24:MI') AS ""上班时间"", to_char(fpt_last_time,'HH24:MI') AS ""下班时间"", come_num AS ""出勤天数"", not_finger_print AS ""未打卡时间"", ask_for_leave_days AS ""请假天数"", ask_for_leave_type AS ""请假类型"", (case come_late_num when 0 THEN N'' else cast(come_late_num as nchar) end) AS ""迟到次数"", ( case leave_early_num when 0 THEN N'' else cast(leave_early_num as nchar) end) AS ""早退次数"", delay_time AS ""延时时间"", meal_subsidy AS ""餐补"", random_str AS ""随即字符串"", record_time AS ""记录时间"", sheet_name AS ""工作表"" from attendance_record ar where ar.name ='{0}' and trunc(ar.fingerprint_date,'DD') between to_date('{1}','YYYY-MM-DD') and to_date('{2}','YYYY-MM-DD') order by ar.fingerprint_date desc", name, dtStartDate.Value.ToString("yyyy-MM-dd"), dtEndDate.Value.ToString("yyyy-MM-dd")); System.Data.DataTable dt = OracleDaoHelper.getDTBySql(sqlStr); this.dgv.DataSource = dt; DGVHelper.AutoSizeForDGV(dgv); }
/// <summary> /// 删除该行。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void delToolStripMenuItem_Click(object sender, EventArgs e) { DataGridViewRow dr = dgv.CurrentRow; if (dr == null) { return; } string name = dr.Cells["姓名"].ToString(); string rest_day = dr.Cells["休息日"].ToString(); TheDaysOfOvertime rd = new TheDaysOfOvertime(name, rest_day); rd.delRestDay(); this.dgv.DataSource = TheDaysOfOvertime.getRestDays(year_And_Month); DGVHelper.AutoSizeForDGV(dgv); }
private void delTheLearnerToolStripMenuItem_Click(object sender, EventArgs e) { DataGridViewRow dgvR = dgv.CurrentRow; if (dgvR == null) { return; } string name = dgvR.Cells["姓名"].Value.ToString(); Learning learner = new Learning(name); learner.del(); ShowResult.show(lblResult, "已删除!", true); timerClsResult.Start(); this.dgv.DataSource = Learning.getAllLearners(); DGVHelper.AutoSizeForDGV(dgv); }
/* * private void timeStartPicker_ValueChanged(object sender, EventArgs e) * { * // _start_hour = timeStartPicker.Value.Hour; * //_start_minute = timeStartPicker.Value.Minute; * if (_start_hour < 8 ) * { * MessageBox.Show("起始时间点必须从8点开始:", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information); * //timeStartPicker.Value = new DateTime(_year, _month,_day, 8, 0, 0); * return; * } * //_start_second = timeStartPicker.Value.Second; * } * private void timeEndPicker_ValueChanged(object sender, EventArgs e) * { * //_end_hour = timeEndPicker.Value.Hour; * //_end_minute = timeEndPicker.Value.Minute; * if (_end_hour >=17 && _end_minute>0) { * MessageBox.Show("结束时间最晚为17:00","提示:",MessageBoxButtons.OK,MessageBoxIcon.Information); * //timeEndPicker.Value = new DateTime(_year, _month, _day, 17, 0,0); * return; * } * //_end_second = timeEndPicker.Value.Second; * } */ /// <summary> /// 删除该假条 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void delByNOToolStripMenuItem_Click(object sender, EventArgs e) { DataGridViewRow dgvR = dgv.CurrentRow; if (dgvR == null) { return; } //string NO = dgvR.Cells["单号"].Value.ToString(); string name = dgvR.Cells["姓名"].Value.ToString(); string year_month_day_str = dgvR.Cells["请假日期"].Value.ToString().Substring(0, 10); // ASK_For_Leave_Helper.delByNameAndMonth(name, year_month_day_str); this.dgv.DataSource = ASK_For_Leave_Helper.getAllVacationListByNameAndDate(cbName.Text.Trim()); DGVHelper.AutoSizeForDGV(dgv); }
private async void AlbumUpsert_Load(object sender, EventArgs e) { var artists = await artistService.Get <List <MArtist> >(null); var genres = await genreService.Get <List <MGenre> >(null); cbArtist.DataSource = artists; cbArtist.ValueMember = "ArtistID"; cbArtist.DisplayMember = "Name"; cbGenre.DataSource = genres; cbGenre.ValueMember = "GenreID"; cbGenre.DisplayMember = "Name"; await LoadListAllTracks(); if (_ID.HasValue) { _album = await albumService.GetById <MAlbum>(_ID.Value); txtName.Text = _album.Name; txtReleaseYear.Text = _album.YearOfRelease.ToString(); txtPrice.Text = _album.Price.ToString(); txtAbout.Text = _album.About; if (_album.Image.Length > 3) { pbAlbumPicture.Image = ImageHelper.ByteArrayToSystemDrawing(_album.Image); pbAlbumPicture.SizeMode = PictureBoxSizeMode.StretchImage; } cbArtist.SelectedItem = artists.Where(i => i.ArtistID == _album.ArtistID).SingleOrDefault(); cbGenre.SelectedItem = genres.Where(i => i.GenreID == _album.GenreID).SingleOrDefault(); albumTracks = await albumService.GetTracks <List <MTrack> >(_ID.Value, null); LoadListAlbumTracks(); } else { DGVHelper.PopulateWithList(dgvAlbumSongs, albumTracks, temp); } }
private void btnQuery_Click(object sender, EventArgs e) { //获取姓名。 string name = cbName.Text.Trim(); if (name.Length == 0) { return; } day = dayPicker.Value.ToString("yyyy-MM-dd"); time = timerPicker.Value.ToString("hh:mm:ss"); v_fillUp = new V_FillUp(name, day, time); System.Data.DataTable dt = v_fillUp.getARRecordToFillUpByName(); this.dgv.DataSource = dt; DGVHelper.AutoSizeForDGV(dgv); }
/// <summary> /// 加载本月考勤记录 /// </summary> private void loadARDetail() { string sqlStr = string.Format(@"select start_date ""起始日期"", end_date ""终止日期"", tabulation_time ""制表日期"", finger_print_date ""按指纹日期"", job_Number ""工号"", name ""姓名"", dept ""部门"", to_char(finger_print_time, 'yy-MM-dd HH24:MI') ""按指纹时间"" from Attendance_Record_Final where name = '{0}' and trunc(finger_print_date, 'MM') = to_date('{1}', 'yyyy-MM') order by finger_print_date asc, finger_print_time asc", cbName.Text.Trim(), year_and_month_str); this.dgvARDetail.DataSource = OracleDaoHelper.getDTBySql(sqlStr); DGVHelper.AutoSizeForDGV(dgvARDetail); }
/// <summary> /// 提交请假 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSubmit_Click(object sender, EventArgs e) { if (!checkName()) { return; } if (tbName.Text.Trim() == "") { return; } startDateTime = new DateTime(_start_year, _start_month, _start_day, _start_hour, _start_minute, _start_second); endDateTime = new DateTime(_end_year, _end_month, _end_day, _end_hour, _end_minute, _end_second); if (startDateTime >= endDateTime) { ShowResult.show(lblResult, "结束时间需比起始时间大!", false); timerClsResult.Enabled = true; return; } string startTime = startDateTime.ToString("yyyy-MM-dd HH:mm:ss"); string endTime = endDateTime.ToString("yyyy-MM-dd HH:mm:ss"); a_F_L_H = new ASK_For_Leave_Helper(tbName.Text.Trim(), startTime, endTime, tbNO.Text.Trim()); //先判断是否有日期范围的假条 if (a_F_L_H.ifExistsAtRange()) { ShowResult.show(lblResult, "已存在该日期范围的假条!", false); timerClsResult.Enabled = true; return; } if (a_F_L_H.ifExistsVacationAtRange()) { ShowResult.show(lblResult, "所设定的范围,涵盖公司休假日,请分段请假!", false); timerClsResult.Enabled = true; return; } a_F_L_H.save(); tbNO.Text = ASK_For_Leave_Helper.getLastedNO(); this.dgv.DataSource = ASK_For_Leave_Helper.getAllVacationList(); DGVHelper.AutoSizeForDGV(dgv); }
private void btnAdd_Click(object sender, EventArgs e) { string line_name = tbLineName.Text.Trim(); string monitor = tbMonitor.Text.Trim(); if (string.IsNullOrEmpty(line_name)) { return; } //判断是否已经存在 if (LineInfo.ifExistsTheLine(line_name)) { ShowResult.show(lblResult, "此线体已存在!", false); timerRestoreTheLblResult.Start(); return; } LineInfo lineInfo = new LineInfo(line_name, monitor); lineInfo.add(); //重新获取线体信息 this.dgv.DataSource = LineInfo.getAllLineInfo(); DGVHelper.AutoSizeForDGV(dgv); }