Esempio n. 1
0
        public ActionResult GetUploadsByPage(int current, int rowCount, string searchPhrase, UploadType type, string key)
        {
            // Load Arguments.
            var args = new ServiceArgs();

            args.AddGridOptions(current, rowCount, Request.Form.GetDynamicSortString(), searchPhrase);
            args.Add("UploadTypeId", (int)type);
            args.Add("UploadKey", key);

            var result = Factory.GetAllByGridPage <IUploadDto>(args);

            return(new JsonCamelCaseResult(result, JsonRequestBehavior.DenyGet));
        }
Esempio n. 2
0
        public ActionResult GetOutstandingInvoicesByPage(int current, int rowCount, string searchPhrase, string currencyId, string shopGuid)
        {
            // Load Arguments.
            var args = new ServiceArgs();

            args.AddGridOptions(current, rowCount, Request.Form.GetDynamicSortString(), searchPhrase);
            args.Add("ShopGuid", shopGuid);
            args.Add("CurrencyId", currencyId);
            // Load Grid Page.
            var repairs = Factory.GetAllByGridPage <IOutstandingInvoiceDto>(args);

            // Return Result.
            return(new JsonCamelCaseResult(repairs, JsonRequestBehavior.DenyGet));
        }
Esempio n. 3
0
        public async Task <ActionResult> GetRepairsByPage(int current, int rowCount, string searchPhrase, string statusFilter, string shopGuid)
        {
            // Load Arguments.
            var args = new ServiceArgs();

            args.AddGridOptions(current, rowCount, Request.Form.GetDynamicSortString(), searchPhrase);
            args.Add("StatusFilter", Enum.TryParse(statusFilter, out RepairStatuses status) ? status : (object)null);
            args.Add("ShopGuid", Guid.TryParse(shopGuid, out Guid shop) ? shop : Guid.Empty);

            // Load Grid Page.
            var repairs = await Factory.GetAllByGridPageAsync <IRepairDto>(args);

            // Return Result.
            return(new JsonCamelCaseResult(repairs, JsonRequestBehavior.DenyGet));
        }
Esempio n. 4
0
        public async Task <ActionResult> GetNotes(NoteType type, string key)
        {
            var canView = User.IsInRole($"{type}NoteView") || User.IsInRole($"{type}NoteEdit");

            if (!canView)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, "Note View Permission Denied."));
            }

            // Load Arguments.
            var args = new ServiceArgs();

            args.Add("NoteTypeId", (int)type);
            args.Add("NoteKey", key);

            var result = await Factory.GetAllAsync <INoteDto>(args);

            return(new JsonCamelCaseResult(result, JsonRequestBehavior.DenyGet));
        }
Esempio n. 5
0
        public ActionResult GetInvoicesByPage(int current, int rowCount, string searchPhrase, string statusFilter)
        {
            // Load Arguments.
            var args = new ServiceArgs();

            args.AddGridOptions(current, rowCount, Request.Form.GetDynamicSortString(), searchPhrase);
            args.Add("StatusFilter", Enum.TryParse(statusFilter, out RepairStatuses status) ? status : (object)null);

            // Load Grid Page.
            var repairs = Factory.GetAllByGridPage <IInvoiceDto>(args);

            // Return Result.
            return(new JsonCamelCaseResult(repairs, JsonRequestBehavior.DenyGet));
        }
Esempio n. 6
0
        public async Task <JsonCamelCaseResult> GetAgingRepairsByPage(int current, int rowCount, string searchPhrase)
        {
            // Load Arguments.
            var args = new ServiceArgs();

            args.AddGridOptions(current, rowCount, Request.Form.GetDynamicSortString(), searchPhrase);
            args.Add("AgingRepairs", true);

            // Load Grid Page.
            var repairs = await Factory.GetAllByGridPageAsync <IRepairDto>(args);

            // Return Result.
            return(new JsonCamelCaseResult(repairs, JsonRequestBehavior.DenyGet));
        }
Esempio n. 7
0
        public async Task <JsonCamelCaseResult> GetRequestsByPage(int current, int rowCount, string searchPhrase, string completedInd)
        {
            // Load Arguments.
            var args = new ServiceArgs();

            args.AddGridOptions(current, rowCount, Request.Form.GetDynamicSortString(), searchPhrase);
            args.Add("CompletedInd", bool.TryParse(completedInd, out var completed) && completed);

            // Load Requests.
            var requests = await Factory.GetAllByGridPageAsync <IRequestDto>(args);

            // Return Requests.
            return(new JsonCamelCaseResult(requests));
        }
        public ActionResult GetRegistrationsByPage(int current, int rowCount, string searchPhrase, string status)
        {
            int registrationStatus = -1; // default value for all.

            int.TryParse(status, out registrationStatus);
            var args = new ServiceArgs();

            args.AddGridOptions(current, rowCount, Request.Form.GetDynamicSortString(), searchPhrase);
            args.Add("Status", registrationStatus);


            var res = Factory.GetAllByGridPage <IRegistrationDto>(args);

            // Load Grid.
            return(new JsonCamelCaseResult(res, JsonRequestBehavior.DenyGet));
        }
Esempio n. 9
0
        public ActionResult GetRecentPaymentsByPage(int current, int rowCount, string searchPhrase, string shopGuid = null)
        {
            // Load Arguments.
            var args = new ServiceArgs();

            args.AddGridOptions(current, rowCount, Request.Form.GetDynamicSortString(), searchPhrase);
            if (string.IsNullOrWhiteSpace(shopGuid))
            {
                args.Add("ShopGuid", shopGuid);
            }
            // Load Grid Page.
            var repairs = Factory.GetAllByGridPage <IRecentPaymentDto>(args);

            // Return Result.
            return(new JsonCamelCaseResult(repairs, JsonRequestBehavior.DenyGet));
        }