private void getInfo() { try { var Company = _CompanyRepo.GetById(id); if (Company != null) { txtName.Text = Company.NAME; //txtTaxCode.Text = Customer.TAX_CODE; txtEmail.Text = Company.EMAIL; txtPhone.Text = Company.PHONE; txtAddress.Text = Company.ADDRESS; } } catch (Exception) { throw; } }
public string getNameCompany(object oid) { int id = Utils.CIntDef(oid); var item = _CompanyRepo.GetById(id); if (item != null) { return(item.NAME); } return(""); }
//GET public ActionResult Edit(int id) { UserViewModel modul = CompanyRepo.GetIdByName(User.Identity.Name); if (modul.Role == "Admin") { CompanyViewModel model = CompanyRepo.GetById(id); return(PartialView("_Edit", model)); } else { return(new RedirectToRouteResult(new RouteValueDictionary(new { controller = "AccessDenied", action = "Index" }))); } }
public JsonResult GetById(int id) { Company company = companyRepo.GetById(id); return(Json(company)); }
public ActionResult Details(int id) { CompanyViewModel model = CompanyRepo.GetById(id); return(PartialView("_Details", model)); }
//GET public ActionResult Edit(int id) { CompanyViewModel model = CompanyRepo.GetById(id); return(PartialView("_Edit", model)); }