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("");
        }
示例#3
0
        //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" })));
            }
        }
示例#4
0
        public JsonResult GetById(int id)
        {
            Company company = companyRepo.GetById(id);

            return(Json(company));
        }
示例#5
0
        public ActionResult Details(int id)
        {
            CompanyViewModel model = CompanyRepo.GetById(id);

            return(PartialView("_Details", model));
        }
示例#6
0
        //GET

        public ActionResult Edit(int id)
        {
            CompanyViewModel model = CompanyRepo.GetById(id);

            return(PartialView("_Edit", model));
        }