Ejemplo n.º 1
0
        public async Task <JsonResult> STInsert()
        {
            var id     = Guid.Parse(Request.Form["id"]);
            var name   = Request.Form["name"];
            var desc   = Request.Form["desc"];
            var oid    = Guid.Parse(Request.Form["oid"]);
            var aid    = Guid.Parse(Request.Form["aid"]);
            var dtid   = Guid.Parse(Request.Form["dtid"]);
            var catID  = Guid.Parse(Request.Form["cid"]);
            var uid    = Guid.Parse(Request.Form["uid"]);
            var sadmin = Guid.Parse("3c35cccc-d48d-4721-9283-d58faeac6cc1");

            try {
                if (!UserAccessLevelService.HasAccess(uid, sadmin))
                {
                    return(Failed(MessageUtilityService.ContactAdmin("Content")));
                }
                if (StatusTypesReferencesService.Insert(id, name, desc, oid, aid, dtid, catID))
                {
                    return(Success(id.ToString()));
                }
                DateTimeStorageService.RemoveAdmin(dtid);
                return(Failed(MessageUtilityService.FailedInsert("")));
            } catch {
                DateTimeStorageService.RemoveAdmin(dtid);
                return(Failed(MessageUtilityService.ServerError()));
            }
        }
        public static DescriptionStorageVM SetSubData(DescriptionStorage model)
        {
            var data = DescriptionStorageVM.MToVM(model);

            data.Category = StatusTypesReferencesVM.MToVM(StatusTypesReferencesService.GetByID(model.CategoryID));
            return(data);
        }
Ejemplo n.º 3
0
        public static ReportClaimsVM SetSubData(ReportClaims data, Guid aid)
        {
            var model = ReportClaimsVM.MToVM(data);

            model.DateTime   = DateTimeStorageVM.MToVM(DateTimeStorageService.GetByID(data.DateTimeStorageID));
            model.ReportType = StatusTypesReferencesVM.MToVM(StatusTypesReferencesService.GetByID(data.ReportTypeID));
            return(model);
        }
        public static IS_ItemStockVM SetSubData(IS_ItemStock data, Guid aid)
        {
            var model = IS_ItemStockVM.MToVM(data);

            model.DateTimeStorage = DateTimeStorageVM.MToVM(DateTimeStorageService.GetByID(data.DateTimeStorageID));
            model.StockStatus     = StatusTypesReferencesVM.MToVM(StatusTypesReferencesService.GetByID(data.StockStatusID));
            return(model);
        }
Ejemplo n.º 5
0
        public static UserAccessLevelVM SetSubData(UserAccessLevel item, Guid aid)
        {
            var model = UserAccessLevelVM.MToVM(item);

            model.AccessLevel  = StatusTypesReferencesVM.MToVM(StatusTypesReferencesService.GetByID(item.AccessLevelID));
            model.DateTimeData = DateTimeStorageVM.MToVM(DateTimeStorageService.GetByID(item.DateTimeStorageID));
            return(model);
        }
Ejemplo n.º 6
0
        public static IS_ItemColorVM SetSubData(IS_ItemColor model)
        {
            var data = IS_ItemColorVM.MToVM(model);

            data.Category = StatusTypesReferencesVM.MToVM(StatusTypesReferencesService.GetByID(model.CategoryID));
            data.Images   = ImageLinkStorageVM.MsToVMs(ImageLinkStorageService.GetByOIDAPI(model.ID, model.API));
            return(data);
        }
        public static GroupingsDataVM SetSubData(GroupingsData data, Guid aid)
        {
            var model = GroupingsDataVM.MToVM(data);

            model.DateTimeData   = DateTimeStorageVM.MToVM(DateTimeStorageService.GetByID(data.DateTimeStorageID));
            model.CategoryStatus = StatusTypesReferencesVM.MToVM(StatusTypesReferencesService.GetByOIDAID(data.CategoryID, aid).FirstOrDefault());
            return(model);
        }
Ejemplo n.º 8
0
 public async Task <JsonResult> STGetByID()
 {
     try {
         var id   = Guid.Parse(Request.Form["id"]);
         var aid  = Guid.Parse(Request.Form["aid"]);
         var data = StatusTypesReferencesService.GetByIDAID(id, aid);
         return(Success(StatusTypesReferencesVM.MToVM(data)));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
        public static MyStoreVM SetSubData(MyStore data, Guid aid)
        {
            var model = MyStoreVM.MToVM(data);

            model.StoreCategory        = StatusTypesReferencesVM.MToVM(StatusTypesReferencesService.GetByID(data.StoreCategoryID));
            model.StoreLogo            = ImageLinkStorageVM.MToVM(ImageLinkStorageService.GetByID(data.StoreLogoID, data.ID, aid));
            model.StoreBackgroundImage = ImageLinkStorageVM.MToVM(ImageLinkStorageService.GetByID(data.StoreBackgroundImageID, data.ID, aid));
            return(model);
        }
Ejemplo n.º 10
0
        public static UserAccessLevelVM SetSubDataAdmin(UserAccessLevel model)
        {
            var data = UserAccessLevelVM.MToVM(model);

            data.AccessLevel  = StatusTypesReferencesVM.MToVM(StatusTypesReferencesService.GetByID(model.AccessLevelID));
            data.DateTimeData = DateTimeStorageVM.MToVM(DateTimeStorageService.GetByID(model.DateTimeStorageID));
            data.Application  = ApplicationInformationVM.MToVM(ApplicationInformationService.GetByID(model.ApplicationID));
            return(data);
        }
        public static QuizQuestionsVM SetSubData(QuizQuestions data, Guid aid, bool isSurvey)
        {
            var model = QuizQuestionsVM.MToVM(data);

            model.Images  = ImageLinkStorageVM.MsToVMs(ImageLinkStorageService.GetByOIDAPI(data.ID, aid));
            model.Status  = StatusTypesReferencesVM.MToVM(StatusTypesReferencesService.GetByID(data.Status));
            model.Choices = isSurvey? QuizQuestionAnswerService.SetSurveyFormats(QuizQuestionAnswerService.GetByQQID(data.ID), aid, data.QuizInfoID) : QuizQuestionAnswerService.SetSubDatas(QuizQuestionAnswerService.GetByQQID(data.ID), aid);
            return(model);
        }
Ejemplo n.º 12
0
        public static QuizInfoVM SetSubData(QuizInfo data, Guid aid)
        {
            var model = QuizInfoVM.MToVM(data);

            model.QuizStatus      = StatusTypesReferencesVM.MToVM(StatusTypesReferencesService.GetByID(data.QuizStatus));
            model.Status          = StatusTypesReferencesVM.MToVM(StatusTypesReferencesService.GetByID(data.Status));
            model.DateTimeStorage = DateTimeStorageVM.MToVM(DateTimeStorageService.GetByID(data.DateTimeStorageID));
            return(model);
        }
Ejemplo n.º 13
0
        public static LeadPagesVM SetSubdata(LeadPages model, Guid api)
        {
            var data = LeadPagesVM.MToVM(model);

            data.BackgroundImage = ImageLinkStorageVM.MToVM(ImageLinkStorageService.GetByID(model.BackgroundImageID, model.ID, api));
            data.MainImage       = ImageLinkStorageVM.MToVM(ImageLinkStorageService.GetByID(model.MainImageID, model.ID, api));
            data.TemplateDesign  = StatusTypesReferencesVM.MToVM(StatusTypesReferencesService.GetByID(model.TemplateDesignID));
            return(data);
        }
Ejemplo n.º 14
0
        public static IS_ItemVM SetSubData(IS_Item data, Guid aid)
        {
            var model = IS_ItemVM.MToVM(data);

            model.DateTimeStorage = DateTimeStorageVM.MToVM(DateTimeStorageService.GetByID(data.DateTimeStorageID));
            model.ItemCategory    = StatusTypesReferencesVM.MToVM(StatusTypesReferencesService.GetByID(data.ItemCategoryID));
            model.ItemColors      = IS_ItemColorService.SetSubDatas(IS_ItemColorService.GetByOwnerID(data.ID, aid));
            model.Images          = ImageLinkStorageVM.MsToVMs(ImageLinkStorageService.GetByOIDAPI(data.ID, aid));
            model.Condition       = StatusTypesReferencesVM.MToVM(StatusTypesReferencesService.GetByID(data.ConditionID));
            return(model);
        }
Ejemplo n.º 15
0
 public async Task <JsonResult> STGetSubData()
 {
     try {
         var cid  = Guid.Parse(Request.Form["id"]);
         var aid  = Guid.Parse(Request.Form["aid"]);
         var oid  = Guid.Parse(Request.Form["cid"]);
         var data = StatusTypesReferencesService.GetByOIDAID(oid, aid);
         var vms  = StatusTypesReferencesService.SetSubDatas(data, cid);
         return(Success(vms));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Ejemplo n.º 16
0
 public async Task <JsonResult> STRemove()
 {
     try {
         var id  = Guid.Parse(Request.Form["id"]);
         var aid = Guid.Parse(Request.Form["aid"]);
         var oid = Guid.Parse(Request.Form["oid"]);
         if (StatusTypesReferencesService.Remove(id, aid, oid))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedRemove("")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Ejemplo n.º 17
0
 public async Task <JsonResult> STUpdate()
 {
     try {
         var id       = Guid.Parse(Request.Form["id"]);
         var aid      = Guid.Parse(Request.Form["aid"]);
         var oid      = Guid.Parse(Request.Form["oid"]);
         var name     = Request.Form["name"];
         var desc     = Request.Form["desc"];
         var category = Guid.Parse(Request.Form["cid"]);
         if (StatusTypesReferencesService.Update(id, aid, oid, name, desc, category))
         {
             return(Success(id.ToString()));
         }
         return(Success(MessageUtilityService.FailedUpdate("")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Ejemplo n.º 18
0
        public async Task <JsonResult> STGet()
        {
            //user id to determine accessLevel
            var uid    = Guid.Parse(Request.Form["id"]);
            var sadmin = Guid.Parse("3c35cccc-d48d-4721-9283-d58faeac6cc1");

            try {
                //check if uid has super admin access
                if (UserAccessLevelService.HasAccess(uid, sadmin))
                {
                    var data = StatusTypesReferencesService.GetAll();
                    return(Success(StatusTypesReferencesService.SetSubDatasAdmin(data)));
                }
                return(Failed(MessageUtilityService.ContactAdmin("Error")));
            } catch {
                return(Failed(MessageUtilityService.ServerError()));
            }
        }