コード例 #1
0
        public ActionResult Create(BaseModel baseModel)
        {
            CompanyModel companyModel = new CompanyModel();

            companyModel.CopyBaseModel(baseModel);

            using (CompanyBAL companyBAL = new CompanyBAL(ContextInfo))
            {
                companyBAL.PrepareCompanyModel(companyModel);
            }

            return(View("Create", companyModel));
        }
コード例 #2
0
        // GET: Company/Edit/5
        public ActionResult Edit(string id, BaseModel baseModel)
        {
            CompanyModel companyModel = new CompanyModel();

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

            using (CompanyBAL companyBAL = new CompanyBAL(ContextInfo))
            {
                companyBAL.GetCompanyModel(companyModel);
                companyBAL.PrepareCompanyModel(companyModel);
            }

            return(View(companyModel));
        }
コード例 #3
0
        public ActionResult Create(CompanyModel companyModel)
        {
            using (CompanyBAL companyBAL = new CompanyBAL(ContextInfo))
            {
                if (ModelState.IsValid)
                {
                    companyBAL.Create(companyModel);
                }

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

                companyBAL.PrepareCompanyModel(companyModel);
            }

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