예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            UserHelper userHelper      = new UserHelper();
            var        currentEmployee = userHelper.GetCurrentLoginUser();

            if (currentEmployee == null || currentEmployee.ID <= 0)
            {
                ParamShiftRequestIDHidden.Value = "";
                ParamDepartmentIDHidden.Value   = "";
            }
            else
            {
                ParamShiftRequestIDHidden.Value = Convert.ToString(currentEmployee.ID);
                ParamDepartmentIDHidden.Value   = Convert.ToString(currentEmployee.Department.LookupId);
            }
            // Set GUID for Web part
            var url = SPContext.Current.Web.Url;
            ShiftManagementDAL shiftManagementDal = new ShiftManagementDAL(url);
            var guidViews = shiftManagementDal.GetViewGuildID().Where(x => x.BaseViewID == BASE_VIEW_ID).FirstOrDefault();

            ShiftRequestsWebPart.ViewGuid = guidViews.ID.ToString();

            // Check shift create permission:
            btnAddNewOvertime.Visible = UserPermission.HasShiftCreation;
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var url = SPContext.Current.Web.Url;
            ShiftManagementDAL shiftManagementDal = new ShiftManagementDAL(url);
            var guidViews = shiftManagementDal.GetViewGuildID().Where(x => x.BaseViewID == BASE_VIEW_ID).FirstOrDefault();

            ShiftApproveWebPart.ViewGuid = guidViews.ID.ToString();
        }