/// <summary> /// Tạo mới bảng chấm công /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void CreateTimeSheetReport_Click(object sender, EventArgs e) { try { var timeReport = new hr_TimeSheetReport { CreatedDate = DateTime.Now }; if (!string.IsNullOrEmpty(hdfDepartmentId.Text)) { timeReport.DepartmentId = Convert.ToInt32(hdfDepartmentId.Text); } if (!string.IsNullOrEmpty(hdfMonth.Text)) { timeReport.Month = Convert.ToInt32(hdfMonth.Text); } if (!string.IsNullOrEmpty(hdfYear.Text)) { timeReport.Year = Convert.ToInt32(hdfYear.Text); } if (!string.IsNullOrEmpty(txtWorkInMonth.Text)) { timeReport.WorkInMonth = double.Parse(txtWorkInMonth.Text); } timeReport.Title = txtTitleTimeSheetReport.Text; timeReport.CreatedDate = DateTime.Now; hr_TimeSheetReportServices.Create(timeReport); grpTimeSheetReportList.Reload(); } catch (Exception ex) { Dialog.ShowNotification("Có lỗi xảy ra" + ex.Message); } }
/// <summary> /// /// </summary> /// <param name="model"></param> /// <returns></returns> public static TimeSheetReportModel Create(TimeSheetReportModel model) { var entity = new hr_TimeSheetReport(); model.FillEntity(ref entity); return(new TimeSheetReportModel(hr_TimeSheetReportServices.Create(entity))); }