public ActionResult View(string id) { CompanyModel companyModel = new CompanyModel(); companyModel.Id = id; using (CompanyBAL companyBAL = new CompanyBAL(ContextInfo)) { companyBAL.GetCompanyModel(companyModel); // companyBAL.PrepareCompanyModel(companyModel); } return(View(companyModel)); }
// 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)); }
public ActionResult Delete(CompanyModel companyModel) { using (CompanyBAL companyBAL = new CompanyBAL(ContextInfo)) { companyBAL.Delete(companyModel); if (companyModel.HasErrorByType()) { companyBAL.GetCompanyModel(companyModel); // companyBAL.PrepareCompanyModel(companyModel); } } return(View(companyModel)); }