Beispiel #1
0
        internal List <calendarVM> GetHolidayListByBranch(int branchId)
        {
            var obj = new List <HolidayList>();
            List <calendarVM> holidayList = new List <calendarVM>();

            obj = GetAll().Where(x => x.BranchID == branchId).ToList();

            foreach (HolidayList item in obj)
            {
                calendarVM list = new calendarVM();
                list.title = item.Description.Replace("'", "");
                list.date  = item.Date;

                var strHref = "";
                if (sessionObj.ROLECODE == UTILITY.ROLE_EMPLOYEE)
                {
                    strHref = "#";
                }
                else
                {
                    strHref = "~/Leave/AddHoliday" + "?HolidayId=" + item.HolidayId;
                }

                var    context = new HttpContextWrapper(System.Web.HttpContext.Current);
                string hrefUrl = UrlHelper.GenerateContentUrl(strHref, context);
                list.url = hrefUrl;
                holidayList.Add(list);
            }

            return(holidayList);
        }
Beispiel #2
0
        internal holidayVm SaveHolidayList(int HolidayId)
        {
            var obj = GetAll();

            if (sessionObj.ROLECODE == UTILITY.ROLE_SUPERADMIN)
            {
                obj = GetAll().ToList();
            }
            else
            {
                obj = GetAll().Where(x => x.BranchID == sessionObj.BRANCHID).ToList();
            }
            holidayVm         holidayVm   = new holidayVm();
            List <calendarVM> holidayList = new List <calendarVM>();

            foreach (HolidayList item in obj)
            {
                calendarVM list = new calendarVM();
                list.title = item.Description;
                list.date  = item.Date;


                var strHref = "~/Leave/AddHoliday" + "?HolidayId=" + item.HolidayId;

                var    context = new HttpContextWrapper(System.Web.HttpContext.Current);
                string hrefUrl = UrlHelper.GenerateContentUrl(strHref, context);
                list.url = hrefUrl;
                holidayList.Add(list);



                holidayVm.calendarVM  = holidayList;
                holidayVm.HolidayList = GetById(HolidayId);
            }

            return(holidayVm);
        }