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
        // 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.º 3
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));
        }