protected void FillTimeApproval(int dayId, int employeeId) { try { string rep_params = ""; Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("1", employeeId.ToString()); parameters.Add("2", dayId.ToString()); parameters.Add("3", dayId.ToString()); parameters.Add("4", "0"); parameters.Add("5", "0"); parameters.Add("6", "0"); parameters.Add("7", "0"); parameters.Add("8", "0"); parameters.Add("9", "0"); parameters.Add("10", "0"); foreach (KeyValuePair <string, string> entry in parameters) { rep_params += entry.Key.ToString() + "|" + entry.Value + "^"; } if (rep_params.Length > 0) { if (rep_params[rep_params.Length - 1] == '^') { rep_params = rep_params.Remove(rep_params.Length - 1); } } ReportGenericRequest req = new ReportGenericRequest(); req.paramString = rep_params; ListResponse <Time> Times = _timeAttendanceService.ChildGetAll <Time>(req); timeCode = ConstTimeVariationType.TimeCodeList(_systemService); if (!Times.Success) { Common.errorMessage(Times); return; } Times.Items.ForEach(x => { x.timeCodeString = timeCode.Where(y => y.key == Convert.ToInt16(x.timeCode)).Count() != 0 ? timeCode.Where(y => y.key == Convert.ToInt32(x.timeCode)).First().value : string.Empty; x.statusString = FillApprovalStatus(x.status); }); Store3.DataSource = Times.Items; ////List<ActiveLeave> leaves = new List<ActiveLeave>(); //leaves.Add(new ActiveLeave() { destination = "dc", employeeId = 8, employeeName = new Model.Employees.Profile.EmployeeName() { fullName = "vima" }, endDate = DateTime.Now.AddDays(10) }); Store3.DataBind(); } catch (Exception exp) { X.Msg.Alert(Resources.Common.Error, exp.Message).Show(); } }
protected void Store1_RefreshData(object sender, StoreReadDataEventArgs e) { try { //GEtting the filter from the page string rep_params = vals.Text; //ReportGenericRequest req = new ReportGenericRequest(); TVListRequest req = new TVListRequest(); req.paramString = rep_params; req.size = "5000"; req.startAt = "0"; req.sortBy = "date,employeeRef"; ListResponse <DashBoardTimeVariation3> daysResponse = _timeAttendanceService.ChildGetAll <DashBoardTimeVariation3>(req); //ActiveAttendanceRequest r = GetActiveAttendanceRequest(); //ListResponse<ActiveAbsence> daysResponse = _timeAttendanceService.ChildGetAll<ActiveAbsence>(r); if (!daysResponse.Success) { Common.errorMessage(daysResponse); return; } bool rtl = _systemService.SessionHelper.CheckIfArabicSession(); List <XMLDictionary> timeCode = ConstTimeVariationType.TimeCodeList(_systemService); List <XMLDictionary> statusList = Common.XMLDictionaryList(_systemService, "13"); List <XMLDictionary> damageList = Common.XMLDictionaryList(_systemService, "22"); daysResponse.Items.ForEach( x => { x.clockDurationString = time(x.clockDuration, true); x.durationString = time(x.duration, true); x.timeCodeString = timeCode.Where(y => y.key == Convert.ToInt16(x.timeCode)).Count() != 0 ? timeCode.Where(y => y.key == Convert.ToInt32(x.timeCode)).First().value : string.Empty; x.apStatusString = statusList.Where(y => y.key == x.apStatus).Count() != 0 ? statusList.Where(y => y.key == x.apStatus).First().value : ""; x.damageLevelString = damageList.Where(y => y.key == x.damageLevel).Count() != 0 ? damageList.Where(y => y.key == x.damageLevel).First().value : ""; if (rtl) { x.dayIdString = DateTime.ParseExact(x.dayId, "yyyyMMdd", new CultureInfo("en")).ToString("dddd dd MMMM yyyy ", new System.Globalization.CultureInfo("ar-AE")); } else { x.dayIdString = DateTime.ParseExact(x.dayId, "yyyyMMdd", new CultureInfo("en")).ToString("dddd dd MMMM yyyy ", new System.Globalization.CultureInfo("en-US")); } } ); Store1.DataSource = daysResponse.Items; Store1.DataBind(); e.Total = daysResponse.count; format.Text = _systemService.SessionHelper.GetDateformat().ToUpper(); } catch (Exception exp) { X.Msg.Alert(Resources.Common.Error, exp.Message).Show(); } }
/// <summary> /// Adding new record /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Store1_RefreshData(object sender, StoreReadDataEventArgs e) { try { string rep_params = vals.Text; ReportGenericRequest r = new ReportGenericRequest(); r.paramString = rep_params; ListResponse <Time> resp = _timeAttendanceService.ChildGetAll <Time>(r); if (!resp.Success) { Common.errorMessage(resp); return; } bool rtl = _systemService.SessionHelper.CheckIfArabicSession(); List <XMLDictionary> timeCodeList = ConstTimeVariationType.TimeCodeList(_systemService); int currentTimeCode; resp.Items.ForEach( x => { if (!string.IsNullOrEmpty(x.clockDuration)) { x.clockDuration = time(Convert.ToInt32(x.clockDuration), true); } if (!string.IsNullOrEmpty(x.duration)) { x.duration = time(Convert.ToInt32(x.duration), true); } if (Int32.TryParse(x.timeCode, out currentTimeCode)) { x.timeCodeString = timeCodeList.Where(y => y.key == Convert.ToInt32(x.timeCode)).Count() != 0 ? timeCodeList.Where(y => y.key == Convert.ToInt32(x.timeCode)).First().value : string.Empty; } x.statusString = FillApprovalStatus(x.status); if (!string.IsNullOrEmpty(x.damageLevel)) { x.damageLevel = FillDamageLevelString(Convert.ToInt16(x.damageLevel)); } if (rtl) { x.dayIdString = ((DateTime)x.date).ToString("dddd dd MMMM yyyy ", new System.Globalization.CultureInfo("ar-AE")); } else { x.dayIdString = ((DateTime)x.date).ToString("dddd dd MMMM yyyy ", new System.Globalization.CultureInfo("en-US")); } } ); Store1.DataSource = resp.Items; Store1.DataBind(); } catch (Exception exp) { X.Msg.Alert(Resources.Common.Error, exp.Message).Show(); } }
protected void PoPuP(object sender, DirectEventArgs e) { int id = Convert.ToInt32(e.ExtraParams["empId"]); string type = e.ExtraParams["type"]; //ReportGenericRequest req = new ReportGenericRequest(); //req.paramString = "1|"+ id + "^2|" + ColStartDate.Value.ToString().Substring(6,4) + ColStartDate.Value.ToString().Substring(3, 2) + // ColStartDate.Value.ToString().Substring(0, 2) + "^3|" + ColEndDate.Value.ToString().Substring(6, 4) + ColEndDate.Value.ToString().Substring(3, 2) + // ColEndDate.Value.ToString().Substring(0, 2) + "^4|35^5|2"; MLDListRequest mlLR = new MLDListRequest(); mlLR.PayId = payId.SelectedItem.Value; mlLR.EmployeeId = id.ToString(); ListResponse <DashBoardTimeVariation2> daysResponse = _timeAttendanceService.ChildGetAll <DashBoardTimeVariation2>(mlLR); if (!daysResponse.Success) { Common.errorMessage(daysResponse); return; } bool rtl = systemService.SessionHelper.CheckIfArabicSession(); List <XMLDictionary> timeCode = ConstTimeVariationType.TimeCodeList(systemService); List <XMLDictionary> statusList = Common.XMLDictionaryList(systemService, "13"); List <XMLDictionary> damageList = Common.XMLDictionaryList(systemService, "22"); daysResponse.Items.ForEach( x => { x.clockDurationString = time(x.clockDuration, true); x.durationString = time(x.duration, true); x.timeCodeString = timeCode.Where(y => y.key == Convert.ToInt16(x.timeCode)).Count() != 0 ? timeCode.Where(y => y.key == Convert.ToInt32(x.timeCode)).First().value : string.Empty; x.apStatusString = statusList.Where(y => y.key == x.apStatus).Count() != 0 ? statusList.Where(y => y.key == x.apStatus).First().value : ""; x.damageLevelString = damageList.Where(y => y.key == x.damageLevel).Count() != 0 ? damageList.Where(y => y.key == x.damageLevel).First().value : ""; if (rtl) { x.dayIdString = DateTime.ParseExact(x.dayId, "yyyyMMdd", new CultureInfo("en")).ToString("dddd dd MMMM yyyy ", new System.Globalization.CultureInfo("ar-AE")); } else { x.dayIdString = DateTime.ParseExact(x.dayId, "yyyyMMdd", new CultureInfo("en")).ToString("dddd dd MMMM yyyy ", new System.Globalization.CultureInfo("en-US")); } } ); TimeVariationStore.DataSource = daysResponse.Items; TimeVariationStore.DataBind(); //e.Total = daysResponse.count; //format.Text = systemService.SessionHelper.GetDateformat().ToUpper(); this.EditRecordWindow.Show(); }
private void FillTimeApproval(string tvId) { string rep_params = ""; try { ReportGenericRequest r = new ReportGenericRequest(); r.paramString = "12|" + tvId; ListResponse <Time> Times = _timeAttendanceService.ChildGetAll <Time>(r); if (!Times.Success) { Common.errorMessage(Times); return; } List <XMLDictionary> timeCodeList = ConstTimeVariationType.TimeCodeList(_systemService); int currentTimeCode; Times.Items.ForEach(x => { if (Int32.TryParse(x.timeCode, out currentTimeCode)) { x.timeCodeString = timeCodeList.Where(y => y.key == Convert.ToInt32(x.timeCode)).Count() != 0 ? timeCodeList.Where(y => y.key == Convert.ToInt32(x.timeCode)).First().value : string.Empty; } x.statusString = FillApprovalStatus(x.status); }); timeApprovalStore.DataSource = Times.Items; //////List<ActiveLeave> leaves = new List<ActiveLeave>(); ////leaves.Add(new ActiveLeave() { destination = "dc", employeeId = 8, employeeName = new Model.Employees.Profile.EmployeeName() { fullName = "vima" }, endDate = DateTime.Now.AddDays(10) }); timeApprovalStore.DataBind(); } catch (Exception exp) { X.Msg.Alert(Resources.Common.Error, exp.Message).Show(); } }
protected void Page_Load(object sender, EventArgs e) { if (!X.IsAjaxRequest && !IsPostBack) { SetExtLanguage(); StartAt.Text = "0"; if (!string.IsNullOrEmpty(Request.QueryString["_fromSelfService"])) { FromSelfService.Text = Request.QueryString["_fromSelfService"]; loaderUrl.Text = "ReportParameterBrowser.aspx?_reportName=SSAD&values="; Panel8.Loader.Url = "ReportParameterBrowser.aspx?_reportName=SSAD"; vals.Text = "1|" + new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1).ToString("yyyyMMdd") + "^2|" + DateTime.Today.ToString("yyyyMMdd"); } else { vals.Text = "6|" + DateTime.Today.ToString("yyyyMMdd") + "^7|" + DateTime.Today.ToString("yyyyMMdd"); FromSelfService.Text = "false"; } format.Text = _systemService.SessionHelper.GetDateformat().ToUpper(); try { AccessControlApplier.ApplyAccessControlOnPage(typeof(AttendanceDay), null, GridPanel1, null, null); } catch (AccessDeniedException exp) { X.MessageBox.ButtonText.Ok = Resources.Common.Ok; X.Msg.Alert(Resources.Common.Error, Resources.Common.ErrorAccessDenied).Show(); Viewport1.Hidden = true; return; } List <XMLDictionary> timeCode = ConstTimeVariationType.TimeCodeList(_systemService); } }
public void DisplayApprovals(string dayId, string employeeId, string shiftId, string code) { ReportGenericRequest req = new ReportGenericRequest(); req.paramString = "1|" + employeeId + "^2|" + dayId + "^3|" + dayId + "^5|" + code; ListResponse <Time> resp = _timeAttendanceService.ChildGetAll <Time>(req); if (!resp.Success) { Common.errorMessage(resp); return; } timeCode = ConstTimeVariationType.TimeCodeList(_systemService); resp.Items.ForEach(x => { x.timeCodeString = timeCode.Where(y => y.key == Convert.ToInt16(x.timeCode)).Count() != 0 ? timeCode.Where(y => y.key == Convert.ToInt32(x.timeCode)).First().value : string.Empty; x.statusString = FillApprovalStatus(x.status); }); Store3.DataSource = resp.Items; Store3.DataBind(); TimeApprovalWindow.Show(); }
protected void Store1_RefreshData(object sender, StoreReadDataEventArgs e) { //GEtting the filter from the page string filter = string.Empty; //Fetching the corresponding list //in this test will take a list of News ListRequest request = new ListRequest(); request.Filter = ""; ListResponse <PenaltyType> response = _PayrollService.ChildGetAll <PenaltyType>(request); if (!response.Success) { Common.errorMessage(response); return; } List <XMLDictionary> timeCode = ConstTimeVariationType.TimeCodeList(_systemService); response.Items.ForEach(x => { x.reasonString = FillReasonString(x.reason); x.timeBaseString = FillTimeBaseString(x.timeBase); x.timeCodeString = timeCode.Where(y => y.key == x.timeCode).Count() != 0 ? timeCode.Where(y => y.key == Convert.ToInt32(x.timeCode)).First().value : string.Empty; }); this.Store1.DataSource = response.Items; e.Total = response.Items.Count;; this.Store1.DataBind(); }
protected void TimeStore_ReadData(object sender, StoreReadDataEventArgs e) { try { //DashboardRequest req = GetDashboardRequest(); //DashboardTimeListRequest r = new DashboardTimeListRequest(); //r.fromDayId = dateRange1.GetRange().DateFrom.ToString("yyyyMMdd"); //r.toDayId = dateRange1.GetRange().DateTo.ToString("yyyyMMdd"); //r.dayId = ""; //r.employeeId = 0; //if (!string.IsNullOrEmpty(_systemService.SessionHelper.GetEmployeeId())) // r.approverId = Convert.ToInt32(_systemService.SessionHelper.GetEmployeeId()); //else //{ // TimeStore.DataSource = new List<Time>(); // TimeStore.DataBind(); // return; //} //r.timeCode = timeVariationType.GetTimeCode(); //r.shiftId = "0"; //r.apStatus = "1"; //r.BranchId = req.BranchId; //r.DivisionId = req.DivisionId; //r.PositionId = req.PositionId; //r.DepartmentId = req.DepartmentId; //r.EsId = req.EsId; //r.Size = "50"; //r.StartAt = "0"; //ListResponse<TimeSelfService> Times = _selfServiceService.ChildGetAll<TimeSelfService>(r); string rep_params = vals.Text; TimeAttendanceViewListRequest req = new TimeAttendanceViewListRequest(); req.paramString = rep_params; req.StartAt = e.Start.ToString(); req.Size = "30"; req.sortBy = "dayId"; ListResponse <TimeSelfService> Times = _selfServiceService.ChildGetAll <TimeSelfService>(req); if (!Times.Success) { Common.errorMessage(Times); return; } List <XMLDictionary> timeCodeList = ConstTimeVariationType.TimeCodeList(_systemService); int currentTimeCode; Times.Items.ForEach(x => { x.fullName = x.employeeName; x.statusString = FillApprovalStatus(x.status); if (Int32.TryParse(x.timeCode, out currentTimeCode)) { x.timeCodeString = timeCodeList.Where(y => y.key == Convert.ToInt32(x.timeCode)).Count() != 0 ? timeCodeList.Where(y => y.key == Convert.ToInt32(x.timeCode)).First().value : string.Empty; } if (string.IsNullOrEmpty(x.notes)) { x.notes = " "; } //if (x.status == 2 || x.status == -1) //{ // btnApprovals.Disabled = true; // btnReject.Disabled = true; //} //else //{ // btnApprovals.Disabled = false; // btnReject.Disabled = false; //} }); // TimeStore.DataSource = Times.Items.Where(x=>x.status==1).ToList<Time>(); ////List<ActiveLeave> leaves = new List<ActiveLeave>(); //leaves.Add(new ActiveLeave() { destination = "dc", employeeId = 8, employeeName = new Model.Employees.Profile.EmployeeName() { fullName = "vima" }, endDate = DateTime.Now.AddDays(10) }); TimeStore.DataSource = Times.Items; TimeStore.DataBind(); } catch (Exception exp) { X.Msg.Alert(Resources.Common.Error, exp.Message).Show(); } }
private void FillReport(bool isInitial = false, bool throwException = true) { string rep_params = vals.Text; ReportGenericRequest req = new ReportGenericRequest(); req.paramString = rep_params; ListResponse <Model.Reports.RT306> resp = _reportsService.ChildGetAll <Model.Reports.RT306>(req); if (!resp.Success) { Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString()); return; } bool rtl = _systemService.SessionHelper.CheckIfArabicSession(); List <XMLDictionary> timeCodeList = ConstTimeVariationType.TimeCodeList(_systemService); resp.Items.ForEach( x => { if (!string.IsNullOrEmpty(x.clockDuration)) { x.clockDurationString = time(Convert.ToInt32(x.clockDuration), true); } if (!string.IsNullOrEmpty(x.duration)) { x.durationString = time(Convert.ToInt32(x.duration), true); } if (!string.IsNullOrEmpty(x.timeCode)) { x.timeCodeString = FillTimeCode(Convert.ToInt32(x.timeCode)); } x.statusString = FillApprovalStatus(x.status); if (!string.IsNullOrEmpty(x.damageLevel)) { x.damageLevel = FillDamageLevelString(Convert.ToInt16(x.damageLevel)); } if (x.date != null) { x.dayId = ((DateTime)x.date).ToString("dddd dd MMMM yyyy ", CultureInfo.CurrentUICulture); } } ); string getLang = _systemService.SessionHelper.getLangauge(); Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text); TimeApproval h = new TimeApproval(parameters, getLang); h.RightToLeft = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No; h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No; h.DataSource = resp.Items; string user = _systemService.SessionHelper.GetCurrentUser(); //h.Parameters["FromParameter"].Value = from; //h.Parameters["ToParameter"].Value = to; h.Parameters["User"].Value = user; // h.Parameters["Filters"].Value = texts.Text; h.CreateDocument(); ASPxWebDocumentViewer1.OpenReport(h); }
//private List<Employee> GetEmployeesFiltered(string query) //{ // EmployeeListRequest req = new EmployeeListRequest(); // req.DepartmentId = "0"; // req.BranchId = "0"; // req.IncludeIsInactive = 2; // req.SortBy = GetNameFormat(); // req.StartAt = "0"; // req.Size = "20"; // req.Filter = query; // ListResponse<Employee> response = _employeeService.GetAll<Employee>(req); // return response.Items; //} //private string GetNameFormat() //{ // return _systemService.SessionHelper.Get("nameFormat").ToString(); //} private void FillReport(bool isInitial = false, bool throwException = true) { string rep_params = vals.Text; ReportGenericRequest req = new ReportGenericRequest(); req.paramString = rep_params; ListResponse <Model.Reports.RT305> resp = _reportsService.ChildGetAll <Model.Reports.RT305>(req); if (!resp.Success) { Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString()); } bool rtl = _systemService.SessionHelper.CheckIfArabicSession(); List <XMLDictionary> timeCodeList = ConstTimeVariationType.TimeCodeList(_systemService); resp.Items.ForEach( x => { // x.justification = "test" + System.Environment.NewLine + "test1" + System.Environment.NewLine + "test2"; x.edAmount = Math.Round(x.edAmount, 2); x.clockDurationString = ConstTimeVariationType.time(x.clockDuration, true); x.durationString = ConstTimeVariationType.time(x.duration, true); x.timeCodeString = timeCodeList.Where(y => y.key == Convert.ToInt32(x.timeCode)).Count() != 0 ? timeCodeList.Where(y => y.key == Convert.ToInt32(x.timeCode)).First().value : string.Empty; x.apStatusString = FillApprovalStatus(x.apStatus); x.damageLevelString = FillDamageLevelString(x.damageLevel); //if (rtl) // x.dayIdString = DateTime.ParseExact(x.dayId, "yyyyMMdd", new CultureInfo("en")).ToString("dddd dd MMMM yyyy ", new System.Globalization.CultureInfo("ar-AE")); //else // x.dayIdString = DateTime.ParseExact(x.dayId, "yyyyMMdd", new CultureInfo("en")).ToString("dddd dd MMMM yyyy ", new System.Globalization.CultureInfo("en-US")); x.dayIdString = DateTime.ParseExact(x.dayId, "yyyyMMdd", new CultureInfo("en")).ToString(_systemService.SessionHelper.GetDateformat()); } ); string getLang = _systemService.SessionHelper.getLangauge(); Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text); Absense h = new Absense(parameters, getLang); h.RightToLeft = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No; h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No; h.DataSource = resp.Items; string user = _systemService.SessionHelper.GetCurrentUser(); // h.Parameters["Filters"].Value = texts.Text; h.Parameters["User"].Value = user; h.PrintingSystem.Document.ScaleFactor = 4; h.CreateDocument(); ASPxWebDocumentViewer1.OpenReport(h); }
protected void PoPuP(object sender, DirectEventArgs e) { try { BasicInfoTab.Reset(); FillDamageStore(); string id = e.ExtraParams["id"]; int dayId = Convert.ToInt32(e.ExtraParams["dayId"]); int employeeId = Convert.ToInt32(e.ExtraParams["employeeId"]); string damageLavel = e.ExtraParams["damage"]; string durationValue = e.ExtraParams["duration"]; string timeCodeParameter = e.ExtraParams["timeCode"]; string shiftId = e.ExtraParams["shiftId"]; string apStatus = e.ExtraParams["apStatus"]; string type = e.ExtraParams["type"]; string justificationParam = e.ExtraParams["justification"]; string clockDuration = e.ExtraParams["clockDuration"]; string arId = e.ExtraParams["arId"]; switch (type) { case "imgEdit": //Step 1 : get the object from the Web Service //Step 2 : call setvalues with the retrieved object damage.Select(damageLavel); duration.Text = durationValue; clock.Text = clockDuration; // recordId.Text = id; justification.Text = justificationParam; TimeApprovalReasonControl.setApprovalReason(arId); if (apStatus == "2" || apStatus == "-1") { disableEditing(false); } else { disableEditing(true); } recordId.Text = id; this.EditRecordWindow.Title = Resources.Common.EditWindowsTitle; this.EditRecordWindow.Show(); break; case "imgDelete": X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig { Yes = new MessageBoxButtonConfig { //We are call a direct request metho for deleting a record Handler = String.Format("App.direct.DeleteRecord({0})", id), Text = Resources.Common.Yes }, No = new MessageBoxButtonConfig { Text = Resources.Common.No } }).Show(); break; case "imgReject": X.Msg.Confirm(Resources.Common.Confirmation, GetLocalResourceObject("RejectRecord").ToString(), new MessageBoxButtonsConfig { Yes = new MessageBoxButtonConfig { //We are call a direct request metho for deleting a record Handler = String.Format("App.direct.RejectRecord({0})", id), Text = Resources.Common.Yes }, No = new MessageBoxButtonConfig { Text = Resources.Common.No } }).Show(); break; case "imgAttach": overrideForm.Reset(); RecordRequest req = new RecordRequest(); //req.employeeId = employeeId.ToString(); //req.dayId = dayId.ToString(); //req.shiftId = shiftId; //req.timeCode = timeCodeParameter; req.RecordID = id; RecordResponse <DashBoardTimeVariation> resp = _timeAttendanceService.ChildGetRecord <DashBoardTimeVariation>(req); if (!resp.Success) { Common.errorMessage(resp); return; } ORId.Text = resp.result.recordId; timeCodeStore.DataSource = ConstTimeVariationType.TimeCodeList(_systemService).Where(x => x.key == Convert.ToInt32(timeCodeParameter)).ToList(); timeCodeStore.DataBind(); FillBranch(); EmployeeQuickViewRecordRequest QVReq = new EmployeeQuickViewRecordRequest(); QVReq.RecordID = employeeId.ToString(); QVReq.asOfDate = DateTime.Now; RecordResponse <EmployeeQuickView> qv = _employeeService.ChildGetRecord <EmployeeQuickView>(QVReq); if (!qv.Success) { Common.errorMessage(qv); return; } overrideForm.SetValues(resp.result); branchId.Select(qv.result.branchId); ListRequest UdIdReq = new ListRequest(); UdIdReq.Filter = ""; ListResponse <BiometricDevice> UdIdResp = _timeAttendanceService.ChildGetAll <BiometricDevice>(UdIdReq); if (!UdIdResp.Success) { Common.errorMessage(UdIdResp); return; } udIdStore.DataSource = UdIdResp.Items; udIdStore.DataBind(); FlatPunchesListRequest FPreq = new FlatPunchesListRequest(); FPreq.shiftId = shiftId; FPreq.sortBy = "clockStamp"; FPreq.StartAt = "0"; FPreq.Size = "30"; ListResponse <FlatPunch> FPresp = _timeAttendanceService.ChildGetAll <FlatPunch>(FPreq); if (!FPresp.Success) { Common.errorMessage(FPresp); return; } punchesList.Text = ""; FPresp.Items.ForEach(x => { punchesList.Text += x.clockStamp.ToString(_systemService.SessionHelper.GetDateformat() + " HH:mm", CultureInfo.CurrentUICulture) + System.Environment.NewLine; } ); inOutStore.DataSource = Common.XMLDictionaryList(_systemService, "34"); inOutStore.DataBind(); overrideWindow.Show(); break; case "LinkRender": FillTimeApproval(id); TimeApprovalWindow.Show(); break; case "imgHistory": TimeVariationHistoryControl1.Show("41203", id); break; default: break; } } catch (Exception exp) { X.Msg.Alert(Resources.Common.Error, exp.Message).Show(); } }
/// <summary> /// Adding new record /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Store1_RefreshData(object sender, StoreReadDataEventArgs e) { try { if (string.IsNullOrEmpty(_systemService.SessionHelper.GetEmployeeId())) { return; } string rep_params = ""; Dictionary <string, string> parameters = new Dictionary <string, string>(); // parameters.Add("1", "1"); if (!string.IsNullOrEmpty(Request.QueryString["_employeeId"]) && !string.IsNullOrEmpty(Request.QueryString["_fromDayId"]) && !string.IsNullOrEmpty(Request.QueryString["_toDayId"])) { parameters.Add("2", Request.QueryString["_fromDayId"]); parameters.Add("3", Request.QueryString["_toDayId"]); parameters.Add("1", Request.QueryString["_employeeId"]); } else { parameters.Add("1", _systemService.SessionHelper.GetEmployeeId()); parameters.Add("2", dateRange1.GetRange().DateFrom.ToString("yyyyMMdd")); parameters.Add("3", dateRange1.GetRange().DateTo.ToString("yyyyMMdd")); if (!string.IsNullOrEmpty(apStatus.Value.ToString())) { parameters.Add("5", apStatus.Value.ToString()); } if (!string.IsNullOrEmpty(timeVariationType.Value.ToString())) { parameters.Add("4", timeVariationType.Value.ToString()); } } foreach (KeyValuePair <string, string> entry in parameters) { rep_params += entry.Key.ToString() + "|" + entry.Value + "^"; } if (rep_params.Length > 0) { if (rep_params[rep_params.Length - 1] == '^') { rep_params = rep_params.Remove(rep_params.Length - 1); } } ReportGenericRequest req = new ReportGenericRequest(); req.paramString = rep_params; ListResponse <TimeVariationSelfService> daysResponse = _selfServiceService.ChildGetAll <TimeVariationSelfService>(req); //ActiveAttendanceRequest r = GetActiveAttendanceRequest(); //ListResponse<ActiveAbsence> daysResponse = _timeAttendanceService.ChildGetAll<ActiveAbsence>(r); if (!daysResponse.Success) { Common.errorMessage(daysResponse); return; } bool rtl = _systemService.SessionHelper.CheckIfArabicSession(); List <XMLDictionary> timeCodeList = ConstTimeVariationType.TimeCodeList(_systemService); daysResponse.Items.ForEach( x => { x.clockDurationString = time(x.clockDuration, true); x.durationString = time(x.duration, true); x.timeCodeString = timeCodeList.Where(y => y.key == Convert.ToInt16(x.timeCode)).Count() != 0 ? timeCodeList.Where(y => y.key == Convert.ToInt32(x.timeCode)).First().value : string.Empty; x.apStatusString = FillApprovalStatus(x.apStatus); x.damageLevelString = FillDamageLevelString(x.damageLevel); if (rtl) { x.dayIdString = DateTime.ParseExact(x.dayId, "yyyyMMdd", new CultureInfo("en")).ToString("dddd dd MMMM yyyy ", new System.Globalization.CultureInfo("ar-AE")); } else { x.dayIdString = DateTime.ParseExact(x.dayId, "yyyyMMdd", new CultureInfo("en")).ToString("dddd dd MMMM yyyy ", new System.Globalization.CultureInfo("en-US")); } } ); Store1.DataSource = daysResponse.Items; Store1.DataBind(); e.Total = daysResponse.count; format.Text = _systemService.SessionHelper.GetDateformat().ToUpper(); } catch (Exception exp) { X.Msg.Alert(Resources.Common.Error, exp.Message).Show(); } }