예제 #1
0
        /// <summary>
        /// Get the Staff under the PIR Access Roles.
        /// </summary>
        /// <returns></returns>
        public JsonResult GetPIRUsers(int reqPage, int pgSize, int skipRow, string searchText = "")
        {
            PIRAccessStaffs pirStaffs = new PIRAccessStaffs();

            try
            {
                pirStaffs.RequestedPage = reqPage;
                pirStaffs.Skip          = skipRow;
                pirStaffs.SearchText    = searchText;
                pirStaffs.Take          = pgSize;
                pirStaffs = new PIRData().GetPIRUsers(pirStaffs);
            }
            catch (Exception ex)
            {
                clsError.WriteException(ex);
            }
            return(Json(pirStaffs, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        /// <summary>
        /// Ajax JsonResult method to insert the staff's record for allow/disallow the Section B in PIR.
        /// </summary>
        /// <param name="pirAccessStaffs"></param>
        /// <returns></returns>
        public JsonResult InsertPIRSectionBAccessStaffs(string pirAccessStaffs = "")
        {
            bool isResult = false;

            try
            {
                PIRAccessStaffs      staffAccess = new PIRAccessStaffs();
                JavaScriptSerializer serializer  = new JavaScriptSerializer();

                staffAccess = serializer.Deserialize <PIRAccessStaffs>(pirAccessStaffs);

                isResult = new PIRData().InsertPIRSectionBAccessStaffs(staffAccess);
            }
            catch (Exception ex)
            {
                clsError.WriteException(ex);
            }
            return(Json(isResult, JsonRequestBehavior.AllowGet));
        }