Ejemplo n.º 1
0
        public ActionResult Create(BaseModel baseModel)
        {
            USAStateModel uSAStateModel = new USAStateModel();

            uSAStateModel.CopyBaseModel(baseModel);

            using (USAStateBAL uSAStateBAL = new USAStateBAL(ContextInfo))
            {
                uSAStateBAL.PrepareUSAStateModel(uSAStateModel);
            }

            return(View("Create", uSAStateModel));
        }
Ejemplo n.º 2
0
        public JsonResult GetUSAStates(DataTableSearchParameters <Nullable <bool> > dataTableSearchParameters)
        {
            GenericListModel <USAStateModel> baseListModel = new GenericListModel <USAStateModel>();

            using (USAStateBAL uSAStateBAL = new USAStateBAL(ContextInfo))
            {
                baseListModel = uSAStateBAL.GetSearchUSAStatesList(dataTableSearchParameters);
            }

            return(Json(new
            {
                baseModel = baseListModel
            }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 3
0
        public ActionResult View(string id)
        {
            USAStateModel uSAStateModel = new USAStateModel();

            uSAStateModel.Id = id;

            using (USAStateBAL uSAStateBAL = new USAStateBAL(ContextInfo))
            {
                uSAStateBAL.GetUSAStateModel(uSAStateModel);
                // uSAStateBAL.PrepareUSAStateModel(uSAStateModel);
            }

            return(View(uSAStateModel));
        }
Ejemplo n.º 4
0
        // GET: USAState/Edit/5
        public ActionResult Edit(string id, BaseModel baseModel)
        {
            USAStateModel uSAStateModel = new USAStateModel();

            uSAStateModel.CopyBaseModel(baseModel);
            uSAStateModel.Id = id;

            using (USAStateBAL uSAStateBAL = new USAStateBAL(ContextInfo))
            {
                uSAStateBAL.GetUSAStateModel(uSAStateModel);
                uSAStateBAL.PrepareUSAStateModel(uSAStateModel);
            }

            return(View(uSAStateModel));
        }
Ejemplo n.º 5
0
        public ActionResult Delete(USAStateModel uSAStateModel)
        {
            using (USAStateBAL uSAStateBAL = new USAStateBAL(ContextInfo))
            {
                uSAStateBAL.Delete(uSAStateModel);

                if (uSAStateModel.HasErrorByType())
                {
                    uSAStateBAL.GetUSAStateModel(uSAStateModel);
                    //     uSAStateBAL.PrepareUSAStateModel(uSAStateModel);
                }
            }

            return(View(uSAStateModel));
        }
Ejemplo n.º 6
0
        public ActionResult Create(USAStateModel uSAStateModel)
        {
            using (USAStateBAL uSAStateBAL = new USAStateBAL(ContextInfo))
            {
                if (ModelState.IsValid)
                {
                    uSAStateBAL.Create(uSAStateModel);
                }

                if (uSAStateModel.HasErrorByType(LMYFrameWorkMVC.Common.LookUps.ErrorType.Critical) || uSAStateModel.HasSuccess(LMYFrameWorkMVC.Common.LookUps.SuccessType.Full))
                {
                    return(base.RedirectToActionWithData(new Dictionary <string, object> {
                        { "baseModel", uSAStateModel }
                    }));
                }

                uSAStateBAL.PrepareUSAStateModel(uSAStateModel);
            }

            return(View("Create", uSAStateModel));
        }