Beispiel #1
0
        public JsonResult Couriers_read(int?pageSize, int?pageNumber, IList <FilterData> filter, string sort)
        {
            GetGeneralResponse <IEnumerable <CourierView> > response = new GetGeneralResponse <IEnumerable <CourierView> >();


            int PageNumber = pageNumber == null ? -1 : (int)pageNumber;
            int PageSize   = pageSize == null ? -1 : (int)pageSize;

            #region Access Check and retrive data

            EmployeeView employee      = GetEmployee();
            bool         hasPermission = employee.IsGuaranteed("Courier_CangeStatus");
            if (hasPermission)
            {
                response = _courierService.GetAllCouriers(PageSize, PageNumber, filter, ConvertJsonToObject(sort));
            }
            else
            {
                response = _courierService.GetAllCouriersByEmployee(PageSize, PageNumber, filter,
                                                                    ConvertJsonToObject(sort), employee.ID);
            }
            #endregion



            return(Json(response, JsonRequestBehavior.AllowGet));
        }
        //1392/11/09 تست شده
        public JsonResult Uncreditservices_Update(EditUncreditServiceRequest request)
        {
            GeneralResponse response = new GeneralResponse();

            #region Access Check

            EmployeeView employee      = GetEmployee();
            bool         hasPermission = employee.IsGuaranteed("UncreditService_Update");
            if (!hasPermission)
            {
                response.ErrorMessages.Add("AccessDenied");
                return(Json(response, JsonRequestBehavior.AllowGet));
            }
            #endregion

            response = _uncreditServiceService.EditUncreditServices(request, employee.ID);

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Beispiel #3
0
        public JsonResult Change_CourierStatus(Guid CourierID, string ExpertComment, int CourierStatuse, Guid?CourierEmployeeID)
        {
            GeneralResponse response = new GeneralResponse();

            #region Access Check

            EmployeeView employee      = GetEmployee();
            bool         hasPermission = employee.IsGuaranteed("Courier_CangeStatus");
            if (!hasPermission)
            {
                response.ErrorMessages.Add("AccessDenied");
                return(Json(response, JsonRequestBehavior.AllowGet));
            }

            #endregion

            Guid courierEmployeeID = CourierEmployeeID == null ? Guid.Empty : (Guid)CourierEmployeeID;
            response = _courierService.DoCourierAction(CourierID, CourierStatuse, ExpertComment, courierEmployeeID, employee.ID);

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
        public JsonResult Uncreditservices_Read(int?pageSize, int?pageNumber, string sort)
        {
            GetGeneralResponse <IEnumerable <UncreditServiceView> > response = new GetGeneralResponse <IEnumerable <UncreditServiceView> >();

            #region Access Check

            EmployeeView employee      = GetEmployee();
            bool         hasPermission = employee.IsGuaranteed("UncreditService_Read");
            if (!hasPermission)
            {
                response.ErrorMessages.Add("AccessDenied");
                return(Json(response, JsonRequestBehavior.AllowGet));
            }
            #endregion

            int PageSize   = pageSize == null ? -1 : (int)pageSize;
            int PageNumber = pageNumber == null ? -1 : (int)pageNumber;

            response = _uncreditServiceService.GetUncreditServices(PageSize, PageNumber, ConvertJsonToObject(sort));

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Beispiel #5
0
        public JsonResult Courier_Insert(AddCourierRequest request)
        {
            GeneralResponse response = new GeneralResponse();

            EmployeeView employee = GetEmployee();

            #region Access Check

            bool hasPermission = employee.IsGuaranteed("Courier_Insert");
            if (!hasPermission)
            {
                response.ErrorMessages.Add("AccessDenied");
                return(Json(response, JsonRequestBehavior.AllowGet));
            }

            #endregion



            response = _courierService.AddCourier(request, employee.ID);

            return(Json(response, JsonRequestBehavior.AllowGet));
        }