public object[] SetOnDutyRequest_ServerEvent(string HolidayId) { object[] oReturn = new object[3]; try { string mailList = ""; string mailResult = ""; DataSet ds = null; ds = CUserVacations.SeUserWorkOnHolidays(CUserInfo.UserId, Convert.ToInt32(HolidayId)); if (ds.Tables[0].Rows[0]["Result"].ToString() == "Done") { string UserName = CUserInfo.FirstName + " " + CUserInfo.LastName; mailList = GetParentsLeaders(CUserInfo.SystemId, CUserInfo.UserId); string OnDutyDate = ds.Tables[0].Rows[0]["OnDutyDate"].ToString(); string DutyDateYear = ds.Tables[0].Rows[0]["Year"].ToString(); mailResult = CUserVacations.SendRequestVacationEmail(mailList, OnDutyDate, OnDutyDate, DutyDateYear, "0", UserName, "2"); oReturn[0] = "Done."; oReturn[1] = mailResult; oReturn[2] = CUser.GetUserVacationsAndDaysOff(CUserInfo.UserId, DateTime.Now.Year); } else { oReturn[0] = "Exist."; oReturn[1] = ""; } } catch (Exception e) { oReturn[0] = null; oReturn[1] = "Error getting Company List.\n\n" + e.Message + "\n\nStack Trace:\n" + e.StackTrace; } return(oReturn); }
public DataSet[] GetHolidaysCalendar(int iUserId) { DataSet[] dsArrayReturn = new DataSet[2]; DataSet ds = CUserVacations.GetListForWorkOnHoliday(CUserInfo.ActualSystemId, CUserInfo.UserId); dsArrayReturn[0] = ds; dsArrayReturn[1] = CalendarDates(ds); return(dsArrayReturn); }
public object[] smartLoad_ServerEvent() { object[] oReturn = new object[6]; try { oReturn[0] = "Done."; oReturn[1] = CUserVacations.GetUserVacationInfo(CUserInfo.UserId, DateTime.Now.Year); oReturn[2] = GetUserYearRequests(CUserInfo.UserId, DateTime.Now.Year); oReturn[3] = GetHolidaysCalendar(CUserInfo.UserId); oReturn[4] = CUserVacations.SetVacationDaysReferences(CUserInfo.ActualSystemId, CUserInfo.UserId); //dtVacationTypes and dtHolidays } catch (Exception ex) { oReturn[0] = null; oReturn[1] = "Error loading vacations.\n\n" + ex.Message + "\n\nStack Trace:\n\n" + ex.StackTrace; } return(oReturn); }
public object[] SendRequestForVacations_ServerEvent(string sCategory, string sFrom, string sTo, string sRequested, string sYear) { object[] oReturn = new object[4]; string mailList = ""; try { DataSet ds = new DataSet(); if (sTo == "") { sTo = sFrom; } if ((sCategory == "1") || (sCategory == "7")) { ds = CUserVacations.SetVacationRequest(CUserInfo.UserId, sFrom, sTo, Convert.ToInt32(sYear), Convert.ToInt32(sCategory)); } else if (sCategory == "4") { ds = CUserVacations.SetVacationRequest(CUserInfo.UserId, sFrom, sTo, DateTime.Now.Year, Convert.ToInt32(sCategory)); } else if (sCategory == "6") { ds = CUserVacations.SeUserCompensatoryDay(CUserInfo.UserId, sFrom, sTo, Convert.ToInt32(sYear)); } string UserName = CUserInfo.FirstName + " " + CUserInfo.LastName; mailList = GetParentsLeaders(CUserInfo.SystemId, CUserInfo.UserId); string mailResult = CUserVacations.SendRequestVacationEmail(mailList, sFrom, sTo, sYear, sRequested, UserName, sCategory); oReturn[0] = "Done."; oReturn[1] = mailResult; oReturn[2] = CUser.GetUserVacationsAndDaysOff(CUserInfo.UserId, Convert.ToInt32(sYear)); oReturn[3] = sCategory; } catch (Exception e) { oReturn[0] = null; oReturn[1] = "Error getting Company List.\n\n" + e.Message + "\n\nStack Trace:\n" + e.StackTrace; } return(oReturn); }