public void GetPropertiesForTRUpdate(int ID_hrStaff, DateTime RequestedDate, List<Entities.EntityViews.tblTimeReport_Transaction_Input> list) { if (!_ArePropReadyTRUpdate.Ready || _ArePropReadyTRUpdate.ID_hrStaff != ID_hrStaff || _ArePropReadyTRUpdate.RequestedDate != RequestedDate) { this._SelectedDate.PropertyValue = RequestedDate.Date; Queries.GetQueries getQ = new Queries.GetQueries(_ServiceConfigParameters); var trHeader = getQ.tbl_trTransactionHeader_Current(ID_hrStaff, RequestedDate); this._SelectedDateTransactionStatus.PropertyValue = trHeader == null ? Constants.TRANSACTION_STATUS.OPEN : trHeader.tbl_trTransactionStatus.TransactionStatus; this._MinHoursDaily.PropertyValue = (decimal)getQ.tbl_hrWorkingHourTemplate_MinHoursDaily(ID_hrStaff, RequestedDate,this._CalendarName.GetValue()); this._TRInputListClient.PropertyValue = list; this.SetRuleValue("DayIsEditableValidation", this._CalendarName.PropertyName); var date = getQ.tbl_trDate_Current(RequestedDate, _CalendarName.GetValue()); if (date != null) { this._SelectedDateType.PropertyValue = date.DateType; this._SelectedDateisOptional.PropertyValue = date.IsOptional; } this.SetRuleValue("AllowHalfDayAbsance", this._PercentPerDay.PropertyName); this.LastOpenDay.PropertyValue = getQ.tbl_trTransactionHeader_LastOpenDay(ID_hrStaff); _ArePropReadyTRUpdate.Ready = true; _ArePropReadyTRUpdate.ID_hrStaff = ID_hrStaff; _ArePropReadyTRUpdate.RequestedDate = RequestedDate; } }
public ResponseItem VoidTest(RequestItem Item) { ResponseItem re = new ResponseItem(Item); re.RequestItem.RequestLog = re.RequestItem.RequestLog + "srv_start: " + DateTime.Now.ToString() + ","; ServiceConfig srvcont = new ServiceConfig(_serviceconfigparameters); decimal? TR_SubmitMinHours = null; Queries.GetQueries getQ = new Queries.GetQueries(_serviceconfigparameters); RuntimeProperties _RuntimeProperties = new RuntimeProperties(_serviceconfigparameters); _RuntimeProperties.GetPersonalProperties(Item.reqp_userid); try { TR_SubmitMinHours = getQ.tbl_hrWorkingHourTemplate_MinHoursDaily(Item.reqp_userid, Item.reqp_date, _RuntimeProperties.CalendarName.GetValue()); // TRS_PrivateGetDailyHourLimitByUser(Item.reqp_date, Item.reqp_userid); TR_SubmitMinHours = TR_SubmitMinHours == null ? Convert.ToDecimal(8.25) : TR_SubmitMinHours; HelperClasses.Serializer srl = new HelperClasses.Serializer(); string hour = srl.NTSoftJsonSerialize(TR_SubmitMinHours.ToString()); re.ResponseBody = hour.Replace(",", "."); re.RequestCompleted = true; } catch (Exception ex) { HelperClasses.ExceptionHandler.LogException(ex, srvcont, Item); //re.ResponseBody = ex.ToString(); re.RequestCompleted = false; } re.RequestItem.RequestLog = re.RequestItem.RequestLog + "srv_finish: " + DateTime.Now.ToString() + ","; return re; }
public void GetPropertiesForTRSubmit(int ID_hrStaff, DateTime RequestedDate) { if (!_ArePropReadyTRSubmit.Ready || _ArePropReadyTRSubmit.ID_hrStaff != ID_hrStaff || _ArePropReadyTRSubmit.RequestedDate != RequestedDate) { Queries.GetQueries getQ = new Queries.GetQueries(_ServiceConfigParameters); this._TRInputList.PropertyValue = getQ.tbl_trTransaction_ByUser_Date(ID_hrStaff, RequestedDate); this._SumOfHours.PropertyValue = this.TRInputList.GetValue<List<Entities.EntityViews.tblTimeReport_Transaction_Input>>().Sum(s => s.Hour); this._FirstSubmitableDay.PropertyValue = getQ.tbl_trTransactionHeader_FirstSubmitableDay(ID_hrStaff, RequestedDate, _DateOfTRStart.GetValue(), _CalendarName.GetValue()); this._WorkingHoursWeekly.PropertyValue = (decimal)getQ.tbl_hrWorkingHourTemplate_WorkingHoursWeekly(ID_hrStaff, RequestedDate); this._MinHoursDaily.PropertyValue = (decimal)getQ.tbl_hrWorkingHourTemplate_MinHoursDaily(ID_hrStaff, RequestedDate,this._CalendarName.GetValue()); this.SetRuleValue("DayIsEditableValidation", this._CalendarName.PropertyName); _ArePropReadyTRSubmit.Ready = true; _ArePropReadyTRSubmit.ID_hrStaff = ID_hrStaff; _ArePropReadyTRSubmit.RequestedDate = RequestedDate; } }