private void SetAxisLables_MonthlyOperationGanttChartSchema(BPersonMonthlyWorkedTime MonthlyOperationBusiness, IList <PersonalMonthlyReportRow> PersonnelMonthlyOperationList) { int min = 0; int max = 24; string minRealTime = string.Empty; string maxRealTime = string.Empty; MonthlyOperationBusiness.GetMinMaxHourForGanttChart(out min, out max); min = (int)Math.Floor((double)this.ConvertScaleByMin_MonthlyOperationGanttChartSchema(min, out minRealTime)); max = (int)Math.Floor((double)this.ConvertScaleByMin_MonthlyOperationGanttChartSchema(max, out maxRealTime)); GanttChartMonthlyOperation_MonthlyOperationGanttChartSchema.ChartAreas["Default"].AxisY.Minimum = min; GanttChartMonthlyOperation_MonthlyOperationGanttChartSchema.ChartAreas["Default"].AxisY2.Minimum = min; GanttChartMonthlyOperation_MonthlyOperationGanttChartSchema.ChartAreas["Default"].AxisY.Maximum = max; GanttChartMonthlyOperation_MonthlyOperationGanttChartSchema.ChartAreas["Default"].AxisY2.Maximum = max; for (int j = min; j <= max; j++) { GanttChartMonthlyOperation_MonthlyOperationGanttChartSchema.ChartAreas["Default"].AxisY.CustomLabels.Add(j - 0.4, j + 0.4, "" + j + ":00"); GanttChartMonthlyOperation_MonthlyOperationGanttChartSchema.ChartAreas["Default"].AxisY2.CustomLabels.Add(j - 0.4, j + 0.4, "" + j + ":00"); } for (int i = 1; i <= PersonnelMonthlyOperationList.Count; i++) { GanttChartMonthlyOperation_MonthlyOperationGanttChartSchema.Series["ConstractorSerie"].Points.AddXY(i, 0, 0); GanttChartMonthlyOperation_MonthlyOperationGanttChartSchema.Series["ConstractorSerie"].Points[i - 1].AxisLabel = PersonnelMonthlyOperationList[PersonnelMonthlyOperationList.Count - i].DayName + " " + PersonnelMonthlyOperationList[PersonnelMonthlyOperationList.Count - i].TheDate; } }
public void GetDateRangeOrder_SomeMonthNullTest() { BPersonMonthlyWorkedTime bpWorkTime = new BPersonMonthlyWorkedTime(ADOPerson3.ID); IList <DateRangeOrderProxy> list = bpWorkTime.GetDateRangeOrder(1390); Assert.Less(list.Count, 12); }
private void CheckMonthlyOperationGridSchemaLoadAccess_MonthlyOperationGridSchema() { string[] retMessage = new string[4]; try { if (HttpContext.Current.Request.QueryString.AllKeys.Contains("PID") && HttpContext.Current.Request.QueryString.AllKeys.Contains("LoadState")) { BPersonMonthlyWorkedTime MonthlyOperationBusiness = BusinessHelper.GetBusinessInstance <BPersonMonthlyWorkedTime>(new KeyValuePair <string, object>("personId", decimal.Parse(this.StringBuilder.CreateString(HttpContext.Current.Request.QueryString["PID"])))); LoadState LS = (LoadState)Enum.Parse(typeof(LoadState), this.StringBuilder.CreateString(HttpContext.Current.Request.QueryString["LoadState"])); switch (LS) { case LoadState.Manager: MonthlyOperationBusiness.CheckMonthlyOperationGridSchemaLoadAccess_onManagerState(); break; case LoadState.Personnel: MonthlyOperationBusiness.CheckMonthlyOperationGridSchemaLoadAccess_onPersonnelState(); break; } } } catch (BaseException ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage); Response.Redirect("WhitePage.aspx?" + typeof(IllegalServiceAccess).Name + "=" + retMessage[1]); } }
private void CheckMonthlyOperationGridSchemaDetailsRowsAccess_MonthlyOperationGridSchema() { string[] retMessage = new string[4]; try { if (HttpContext.Current.Request.QueryString.AllKeys.Contains("PID") && HttpContext.Current.Request.QueryString.AllKeys.Contains("LoadState")) { BPersonMonthlyWorkedTime MonthlyOperationBusiness = BusinessHelper.GetBusinessInstance <BPersonMonthlyWorkedTime>(new KeyValuePair <string, object>("personId", decimal.Parse(this.StringBuilder.CreateString(HttpContext.Current.Request.QueryString["PID"])))); LoadState LS = (LoadState)Enum.Parse(typeof(LoadState), this.StringBuilder.CreateString(HttpContext.Current.Request.QueryString["LoadState"])); switch (LS) { case LoadState.Manager: break; case LoadState.Personnel: MonthlyOperationBusiness.CheckMonthlyOperationGridSchemaDetailsRowsAccess_onPersonnelState(); break; } } } catch (BaseException ex) { this.GridMasterMonthlyOperation_MasterMonthlyOperation.Levels.RemoveAt(1); } }
/// <summary> /// بادریافت شماره پرسنلی ، کارکرد را برمیگرداند /// </summary> /// <param name="personCode">شماره پرسنلی</param> /// <param name="fromDate">تاریخ شروع</param> /// <param name="toDate">تاریخ پایان</param> /// <returns></returns> private TAProxy Fill(string personCode, DateTime fromDate, DateTime toDate) { BPerson personBusiness = new BPerson(); var person = personBusiness.GetByBarcode(personCode); if (person == null) { return(new TAProxy()); } IList <PersonalMonthlyReportRow> PersonnelMonthlyOperationList = null; PersonalMonthlyReportRow PersonnelSummaryMonthlyOperation = null; BPersonMonthlyWorkedTime MonthlyOperationBusiness = new BPersonMonthlyWorkedTime(person.ID); var personDateRangeReportProxy = MonthlyOperationBusiness.GetPersonDateRangeReport(fromDate, toDate).FirstOrDefault(); TAProxy proxy = new TAProxy(); proxy.PersonCode = personCode; proxy.HozourTime = personDateRangeReportProxy.PresenceDuration; //35 * 60;//"35:00" proxy.KasreKarTime = personDateRangeReportProxy.HourlyUnallowableAbsence; //2 * 60 + 50;//"02:50" proxy.MamuriatTime = personDateRangeReportProxy.HourlyMission; //12 * 60;//"12:00" proxy.KarkerdSum = personDateRangeReportProxy.ImpureOperation; //47 * 60;//12:00 + 35:00 return(proxy); }
public DailyReportProxy GetPersonDailyReport(decimal personId, string miladiDate) { try { DateTime dayDate = Utility.ToMildiDateTime(miladiDate); BPersonMonthlyWorkedTime monthlyReport = new BPersonMonthlyWorkedTime(personId); PersonalMonthlyReportRow row = monthlyReport.GetPersonDailyReport(dayDate); DailyReportProxy proxy = new DailyReportProxy(); proxy.AllowableOverTime = row.AllowableOverTime; proxy.DailyAbsence = row.DailyAbsence; proxy.DailyMission = row.DailyMission; proxy.HourlyMeritoriouslyLeave = row.HourlyMeritoriouslyLeave; proxy.HourlyMission = row.HourlyMission; proxy.HourlyPureOperation = row.HourlyPureOperation; proxy.HourlySickLeave = row.HourlySickLeave; proxy.HourlyUnallowableAbsence = row.HourlyUnallowableAbsence; proxy.HourlyWithoutPayLeave = row.HourlyWithoutPayLeave; proxy.ShiftPairs = row.ShiftPairs; return(proxy); } catch (Exception ex) { LogException(ex, "BTraffic", "GetPersonDailyReport"); throw ex; } }
public void GetDateRangeOrder_Test() { BPersonMonthlyWorkedTime bpWorkTime = new BPersonMonthlyWorkedTime(ADOPerson4.ID); IList <DateRangeOrderProxy> list = bpWorkTime.GetDateRangeOrder(1390); Assert.AreEqual(12, list.Count); Assert.AreEqual(1, list.Where(x => x.Selected).Count()); }
public void GetReport_PriodicValuesTest_Dependent() { BPersonMonthlyWorkedTime bpWorkTime = new BPersonMonthlyWorkedTime(32687); IList <PersonalMonthlyReportRow> DailyRows = null; PersonalMonthlyReportRow MonthlyRow = null; bpWorkTime.GetPersonMonthlyReport(1390, 7, "1390/06/16", "1390/07/15", out DailyRows, out MonthlyRow); Assert.IsTrue(MonthlyRow.PeriodicPresenceDuration != "00:00" && MonthlyRow.PeriodicPresenceDuration != ""); }
public void GetReportDetail_Test_Dependent() { try { BPersonMonthlyWorkedTime bpWorkTime = new BPersonMonthlyWorkedTime(32688); IList <MonthlyDetailReportProxy> df = bpWorkTime.GetPersonMonthlyRowDetail(DateTime.Now.AddDays(-6)); } catch (Exception ex) { Assert.Fail(ex.Message); } }
public void GetReport_PersonalDailyReportTest() { try { PersianDateTime dt = new PersianDateTime(DateTime.Now); BPersonMonthlyWorkedTime pb = new BPersonMonthlyWorkedTime(32688); ClearSession(); PersonalMonthlyReportRow row = pb.GetPersonDailyReport(Utility.ToMildiDate("1390/06/03")); string value = row.PeriodicDailyPureOperation; } catch (Exception ex) { Assert.Fail(ex.Message); } }
protected void Button3_Click(object sender, EventArgs e) { LanguagesName l = GTS.Clock.Business.AppSettings.BLanguage.CurrentLocalLanguage; PersianDateTime dt = new PersianDateTime(DateTime.Now); BPersonMonthlyWorkedTime pb = new BPersonMonthlyWorkedTime(BUser.CurrentUser.Person.ID); IList <PersonalMonthlyReportRow> list1; PersonalMonthlyReportRow monthlyRow; pb.GetPersonMonthlyReport(1391, 5, "1391/07/20", "1391/08/19", out list1, out monthlyRow); string value = monthlyRow.HourlyPureOperation; }
public void GetReport_PersonalMonthlyReportTest() { try { PersianDateTime dt = new PersianDateTime(DateTime.Now); BPersonMonthlyWorkedTime pb = new BPersonMonthlyWorkedTime(32688); IList <PersonalMonthlyReportRow> list1; PersonalMonthlyReportRow monthlyRow; pb.GetPersonMonthlyReport(1390, 6, "1390/06/01", "1390/06/31", out list1, out monthlyRow); string value = monthlyRow.PeriodicDailyPureOperation; } catch (Exception ex) { Assert.Fail(ex.Message); } }
public void GetReport_PersonalMonthlyReportPropertyTest() { try { BPersonMonthlyWorkedTime bpWorkTime = new BPersonMonthlyWorkedTime(32688); IList <PersonalMonthlyReportRow> DailyRows = null; PersonalMonthlyReportRow MonthlyRow = null; bpWorkTime.GetPersonMonthlyReport(1390, 6, "1390/05/10", "1390/06/15", out DailyRows, out MonthlyRow); string value = DailyRows[0].DailySickLeave; value = DailyRows[1].DailySickLeave; } catch (Exception Exception) { Assert.Fail(Exception.Message); } }
private void SetReserveFieldsHeaderColumnsCaption_MasterMonthlyOperation(Table table) { BPersonMonthlyWorkedTime MonthlyOperationBusiness = new BPersonMonthlyWorkedTime(0); TableCellCollection gcc = table.Rows[0].Cells; IDictionary <ConceptReservedFields, string> ConceptsReservedFieldsReservedFieldsDic = MonthlyOperationBusiness.GetReservedFieldsNames(); foreach (string conceptReservedFieldName in Enum.GetNames(typeof(ConceptReservedFields))) { for (int i = 0; i < gcc.Count; i++) { if (gcc[i].ID == conceptReservedFieldName) { //gcc[i].Text = MonthlyOperationBusiness.GetReservedFieldsName((ConceptReservedFields)Enum.Parse(typeof(ConceptReservedFields), conceptReservedFieldName)); gcc[i].Text = ConceptsReservedFieldsReservedFieldsDic[(ConceptReservedFields)Enum.Parse(typeof(ConceptReservedFields), conceptReservedFieldName)]; break; } } } }
private void SetReserveFieldsHeaderColumnsCaption_MasterMonthlyOperation(ComponentArt.Web.UI.Grid grid) { BPersonMonthlyWorkedTime MonthlyOperationBusiness = new BPersonMonthlyWorkedTime(0); GridColumnCollection Gcc = grid.Levels[0].Columns; IDictionary <ConceptReservedFields, string> ConceptsReservedFieldsReservedFieldsDic = MonthlyOperationBusiness.GetReservedFieldsNames(); foreach (string conceptReservedFieldName in Enum.GetNames(typeof(ConceptReservedFields))) { for (int i = 0; i < Gcc.Count; i++) { if (Gcc[i].DataField == conceptReservedFieldName) { //Gcc[i].HeadingText = MonthlyOperationBusiness.GetReservedFieldsName((ConceptReservedFields)Enum.Parse(typeof(ConceptReservedFields), conceptReservedFieldName)); Gcc[i].HeadingText = ConceptsReservedFieldsReservedFieldsDic[(ConceptReservedFields)Enum.Parse(typeof(ConceptReservedFields), conceptReservedFieldName)]; break; } } } }
public void GetReport_EmptyDateRangeValidate() { try { BPersonMonthlyWorkedTime bpWorkTime = new BPersonMonthlyWorkedTime(ADOPerson1.ID); IList <PersonalMonthlyReportRow> DailyRows = null; PersonalMonthlyReportRow MonthlyRow = null; bpWorkTime.GetPersonMonthlyReport(2000, 2, "", "", out DailyRows, out MonthlyRow); PersonalMonthlyReportRow pmrr = DailyRows[0]; Assert.Fail("دوره محاسبات ندارد"); } catch (InvalidDatabaseStateException ex) { Assert.Pass(ex.Message); } catch (Exception ex) { Assert.Fail(ex.Message); } }
private void FillChilds_GridMasterMonthlyOperation_MasterMonthlyOperation(GridNeedChildDataSourceEventArgs e) { if (e.Item.Level == 0) { Dictionary <string, object> obj = this.GetParameters_GridMasterMonthlyOperation_MasterMonthlyOperation(); LoadState LS = (LoadState)obj["LoadState"]; decimal PersonnelID = (decimal)obj["PersonnelID"]; switch (LS) { case LoadState.Manager: break; case LoadState.Personnel: PersonnelID = BUser.CurrentUser.Person.ID; break; } BPersonMonthlyWorkedTime MonthlyOperationBusiness = new BPersonMonthlyWorkedTime(PersonnelID); IList <MonthlyDetailReportProxy> MonthlyDetailReportProxyList = MonthlyOperationBusiness.GetPersonMonthlyRowDetail((DateTime)e.Item["Date"]); e.DataSource = MonthlyDetailReportProxyList; } }
protected void Button42_Click(object sender, EventArgs e) { #region SetGridColumnsSize_MasterMonthlyOperation BGridMonthlyOperationClientSettings MonthlyOperationGridClientSettingsBusiness = new BGridMonthlyOperationClientSettings(); MonthlyOperationGridClientGeneralSettings monthlyOperationGridClientGeneralSettings = MonthlyOperationGridClientSettingsBusiness.GetMonthlyOperationGridGeneralClientSettings(); #endregion #region SetVisibleColumns_MasterMonthlyOperation MonthlyOperationGridClientSettings monthlyOperationGridClientSettings = MonthlyOperationGridClientSettingsBusiness.GetMonthlyOperationGridClientSettings(); #endregion #region SetReserveFieldsHeaderColumnsCaption_MasterMonthlyOperation BPersonMonthlyWorkedTime MonthlyOperationBusiness = new BPersonMonthlyWorkedTime(0); IDictionary <ConceptReservedFields, string> dic = MonthlyOperationBusiness.GetReservedFieldsNames(); /*foreach (string conceptReservedFieldName in Enum.GetNames(typeof(ConceptReservedFields))) * { * string HeadingText = MonthlyOperationBusiness.GetReservedFieldsName((ConceptReservedFields)Enum.Parse(typeof(ConceptReservedFields), conceptReservedFieldName)); * }*/ #endregion #region Fill_GridMasterMonthlyOperation_MasterMonthlyOperation IList <PersonalMonthlyReportRow> PersonnelMonthlyOperationList = null; PersonalMonthlyReportRow PersonnelSummaryMonthlyOperation = null; try { decimal PersonnelID = BUser.CurrentUser.Person.ID; BPersonMonthlyWorkedTime MonthlyOperationBusiness1 = new BPersonMonthlyWorkedTime(PersonnelID); MonthlyOperationBusiness.GetPersonMonthlyReport(1391, 12, "1391/12/01", "1391/12/29", out PersonnelMonthlyOperationList, out PersonnelSummaryMonthlyOperation); Dictionary <string, object> MonthlyOperationSourceDic = new Dictionary <string, object>(); MonthlyOperationSourceDic.Add("Details", PersonnelMonthlyOperationList); MonthlyOperationSourceDic.Add("Summary", PersonnelSummaryMonthlyOperation); } catch { } #endregion }
public void GetUnderManagmentBySearch_BarcodeTest22222() { try { BPersonMonthlyWorkedTime bpWorkTime = new BPersonMonthlyWorkedTime(32687); IList <PersonalMonthlyReportRow> DailyRows = null; PersonalMonthlyReportRow MonthlyRow = null; bpWorkTime.GetPersonMonthlyReport(1390, 7, "1390/08/01", "1390/08/30", out DailyRows, out MonthlyRow); string a = DailyRows[0].UnallowableOverTime; IList <PersonalMonthlyReportRow> xxx = DailyRows.Where(x => x.HourlyPureOperation != "00:00").ToList(); PersonalMonthlyReportRow pmrr = DailyRows[2]; string x0 = pmrr.ImpureOperation; string x1 = pmrr.PeriodicDailyAbsence; string x2 = pmrr.DailyAbsence; User user = BUser.CurrentUser; IList <MonthlyDetailReportProxy> list2 = bpWorkTime.GetPersonMonthlyRowDetail(new DateTime(2011, 9, 7)); } catch (Exception ex) { } }
private void Fill_GanttChartMonthlyOperation_MonthlyOperationGanttChartSchema(LoadState LS, decimal PersonnelID, int Year, int Month, string FromDate, string ToDate) { string[] retMessage = new string[4]; IList <PersonalMonthlyReportRow> PersonnelMonthlyOperationList = null; IList <TaskFeatures> TaskFeaturesList = new List <TaskFeatures>(); Dictionary <string, Series> AvailableGanttSeriesDic = new Dictionary <string, Series>(); try { this.Clear_DataPointCollection_MonthlyOperationGanttChartSchema(); if (Session["Year_MonthlyOperationGanttChartSchema"] != null) { if ((int)Session["Year_MonthlyOperationGanttChartSchema"] != Year) { Session["MonthlyOperationSource_MonthlyOperationGanttChartSchema"] = null; } } if (Session["Month_MonthlyOperationGanttChartSchema"] != null) { if ((int)Session["Month_MonthlyOperationGanttChartSchema"] != Month) { Session["MonthlyOperationSource_MonthlyOperationGanttChartSchema"] = null; } } switch (LS) { case LoadState.Manager: break; case LoadState.Personnel: PersonnelID = BUser.CurrentUser.Person.ID; break; } BPersonMonthlyWorkedTime MonthlyOperationBusiness = new BPersonMonthlyWorkedTime(PersonnelID); if (Session["MonthlyOperationSource_MonthlyOperationGanttChartSchema"] == null) { PersonnelMonthlyOperationList = MonthlyOperationBusiness.GetPersonGanttChart(Year, Month, FromDate, ToDate).Reverse().ToList(); Session.Add("MonthlyOperationSource_MonthlyOperationGanttChartSchema", PersonnelMonthlyOperationList); Session.Add("Year_MonthlyOperationGanttChartSchema", Year); Session.Add("Month_MonthlyOperationGanttChartSchema", Month); } else { PersonnelMonthlyOperationList = (IList <PersonalMonthlyReportRow>)(Session["MonthlyOperationSource_MonthlyOperationGanttChartSchema"]); } this.SetAxisLables_MonthlyOperationGanttChartSchema(MonthlyOperationBusiness, PersonnelMonthlyOperationList.Reverse().ToList()); IList <GanttChartSettingsProxy> GanttChartSettingsProxyList = this.GetGanttChartSettings_MonthlyOperationGanttChartSchema(); for (int i = 1; i <= PersonnelMonthlyOperationList.Count; i++) { foreach (GanttChartSettingsProxy ganttChartSettingsProxyItem in GanttChartSettingsProxyList) { if (ganttChartSettingsProxyItem.ViewState) { string ConceptType = "Pairly" + ganttChartSettingsProxyItem.ConceptTitle; PersonalMonthlyReportRowDetail personalMonthlyReportRowDetail = ((PersonalMonthlyReportRowDetail)(typeof(PersonalMonthlyReportRow).GetProperty(ConceptType).GetValue(PersonnelMonthlyOperationList[i - 1], null))); foreach (IPair pair in personalMonthlyReportRowDetail.Pairs) { if (pair.From != pair.To) { string realFromTime = string.Empty; string realToTime = string.Empty; double FromTime = this.ConvertScaleByMin_MonthlyOperationGanttChartSchema(pair.From, out realFromTime); double ToTime = this.ConvertScaleByMin_MonthlyOperationGanttChartSchema(pair.To, out realToTime); Series serie = GanttChartMonthlyOperation_MonthlyOperationGanttChartSchema.Series[ganttChartSettingsProxyItem.ConceptTitle]; serie.Points.AddXY(i, FromTime, ToTime); DataPointCollection dataPointCollection = serie.Points; this.SetConceptColor_MonthlyOperationGanttChartSchema(personalMonthlyReportRowDetail, serie); this.SetDataPointFeatures_MonthlyOperationGanttChartSchema(TaskFeaturesList, ConceptType, realFromTime, realToTime, PersonnelMonthlyOperationList[i - 1], personalMonthlyReportRowDetail, serie, dataPointCollection); if (!AvailableGanttSeriesDic.ContainsKey(ganttChartSettingsProxyItem.ConceptTitle)) { AvailableGanttSeriesDic.Add(ganttChartSettingsProxyItem.ConceptTitle, serie); } } } } } this.SetDataPointFeatures_MonthlyOperationGanttChartSchema(TaskFeaturesList); this.SetAttributes_MonthlyOperationGanttChartSchema(); this.CustomizeGanttLegends_MonthlyOperationGanttChartSchema(AvailableGanttSeriesDic); } this.operationYearMonthProvider.SetOperationYearMonth(Year, Month); } catch (UIValidationExceptions ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage); this.ErrorHiddenField_MonthlyOperationGanttChartSchema.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } catch (UIBaseException ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage); this.ErrorHiddenField_MonthlyOperationGanttChartSchema.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } catch (Exception ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage); this.ErrorHiddenField_MonthlyOperationGanttChartSchema.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } }
protected void Button37_Click(object sender, EventArgs e) { BPersonMonthlyWorkedTime bus = new BPersonMonthlyWorkedTime(BUser.CurrentUser.Person.ID); bus.GetPersonGanttChart(1392, 1, "1391/12/21", "1392/01/20"); }
private void Fill_GridMasterMonthlyOperation_MasterMonthlyOperation(LoadState LS, decimal PersonnelID, int Year, int Month, string FromDate, string ToDate) { string[] retMessage = new string[4]; IList <PersonalMonthlyReportRow> PersonnelMonthlyOperationList = null; PersonalMonthlyReportRow PersonnelSummaryMonthlyOperation = null; try { if (Session["Year_MasterMonthlyOperation"] != null) { if ((int)Session["Year_MasterMonthlyOperation"] != Year) { Session["MonthlyOperationSource_MasterMonthlyOperation"] = null; } } if (Session["Month_MasterMonthlyOperation"] != null) { if ((int)Session["Month_MasterMonthlyOperation"] != Month) { Session["MonthlyOperationSource_MasterMonthlyOperation"] = null; } } if (Session["MonthlyOperationSource_MasterMonthlyOperation"] == null) { switch (LS) { case LoadState.Manager: break; case LoadState.Personnel: PersonnelID = BUser.CurrentUser.Person.ID; break; } BPersonMonthlyWorkedTime MonthlyOperationBusiness = new BPersonMonthlyWorkedTime(PersonnelID); MonthlyOperationBusiness.GetPersonMonthlyReport(Year, Month, FromDate, ToDate, out PersonnelMonthlyOperationList, out PersonnelSummaryMonthlyOperation); //DateRangeHelper drh = new DateRangeHelper(); //drh.GetPersonMonthlyReport(Year, Month, FromDate, ToDate, out PersonnelMonthlyOperationList, out PersonnelSummaryMonthlyOperation); Session.Add("Year_MasterMonthlyOperation", Year); Session.Add("Month_MasterMonthlyOperation", Month); Dictionary <string, object> MonthlyOperationSourceDic = new Dictionary <string, object>(); MonthlyOperationSourceDic.Add("Details", PersonnelMonthlyOperationList); MonthlyOperationSourceDic.Add("Summary", PersonnelSummaryMonthlyOperation); Session.Add("MonthlyOperationSource_MasterMonthlyOperation", MonthlyOperationSourceDic); } this.operationYearMonthProvider.SetOperationYearMonth(Year, Month); GridMasterMonthlyOperation_MasterMonthlyOperation.DataSource = (IList <PersonalMonthlyReportRow>)((Dictionary <string, object>)Session["MonthlyOperationSource_MasterMonthlyOperation"])["Details"]; GridMasterMonthlyOperation_MasterMonthlyOperation.DataBind(); } catch (UIValidationExceptions ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage); this.ErrorHiddenField_MonthlyOperation.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } catch (UIBaseException ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage); this.ErrorHiddenField_MonthlyOperation.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } catch (Exception ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage); this.ErrorHiddenField_MonthlyOperation.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } }
private void Fill_cmbMonth_MasterMonthlyOperation(LoadState LS, int Year, decimal PersonnelID) { string[] retMessage = new string[4]; try { string CurrentLangID = string.Empty; string SysLangID = string.Empty; string Identifier = string.Empty; int month = 0; DateTime currentDateTime = DateTime.Now; CurrentLangID = this.LangProv.GetCurrentLanguage(); SysLangID = this.LangProv.GetCurrentSysLanguage(); switch (SysLangID) { case "en-US": switch (CurrentLangID) { case "en-US": Identifier = "ee"; break; case "fa-IR": Identifier = "ef"; break; } month = currentDateTime.Month; break; case "fa-IR": switch (CurrentLangID) { case "en-US": Identifier = "fe"; break; case "fa-IR": Identifier = "ff"; break; } PersianCalendar pCal = new PersianCalendar(); month = pCal.GetMonth(currentDateTime); break; } switch (LS) { case LoadState.Manager: break; case LoadState.Personnel: PersonnelID = BUser.CurrentUser.Person.ID; break; } //DateRangeHelper drh = new DateRangeHelper(); //IList<DateRangeHelper.DateRangeOrderProxy> DateRangeOrderProxyList = drh.GetDateRangeOrder(Year); BPersonMonthlyWorkedTime MonthlyOperationBusiness = new BPersonMonthlyWorkedTime(PersonnelID); IList <DateRangeOrderProxy> DateRangeOrderProxyList = MonthlyOperationBusiness.GetDateRangeOrder(Year); DateRangeDetails dateRangeDetails = new DateRangeDetails(); for (int i = 1; i <= DateRangeOrderProxyList.Count; i++) { dateRangeDetails.FromDate = DateRangeOrderProxyList[i - 1].FromDate; dateRangeDetails.ToDate = DateRangeOrderProxyList[i - 1].ToDate; dateRangeDetails.Order = DateRangeOrderProxyList[i - 1].Order.ToString(); ComboBoxItem cmbItemMonth = new ComboBoxItem(GetLocalResourceObject("Month" + i + "" + Identifier + "").ToString()); cmbItemMonth.Value = this.JsSerializer.Serialize(dateRangeDetails); this.cmbMonth_MasterMonthlyOperation.Items.Add(cmbItemMonth); if (DateRangeOrderProxyList[i - 1].Selected && Session["CurrentOperationMonth"] == null) { this.cmbMonth_MasterMonthlyOperation.SelectedIndex = i - 1; this.hfCurrentMonth_MasterMonthlyOperation.Value = cmbItemMonth.Value; } } if (Session["CurrentOperationMonth"] != null) { OperationYearMonthProvider.OperationMonthObj operationMonthObj = (OperationYearMonthProvider.OperationMonthObj)Session["CurrentOperationMonth"]; dateRangeDetails.FromDate = DateRangeOrderProxyList[operationMonthObj.Index].FromDate; dateRangeDetails.ToDate = DateRangeOrderProxyList[operationMonthObj.Index].ToDate; dateRangeDetails.Order = DateRangeOrderProxyList[operationMonthObj.Index].Order.ToString(); this.cmbMonth_MasterMonthlyOperation.Items[operationMonthObj.Index].Value = this.JsSerializer.Serialize(dateRangeDetails); this.hfCurrentMonth_MasterMonthlyOperation.Value = this.cmbMonth_MasterMonthlyOperation.Items[operationMonthObj.Index].Value; this.cmbMonth_MasterMonthlyOperation.SelectedIndex = operationMonthObj.Index; } } catch (UIValidationExceptions ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage); this.ErrorHiddenField_Months_MasterMonthlyOperation.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } catch (UIBaseException ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage); this.ErrorHiddenField_Months_MasterMonthlyOperation.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } catch (Exception ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage); this.ErrorHiddenField_Months_MasterMonthlyOperation.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } }