public ActionResult Edit(int oid) { if (Request.Cookies["CRLocationEn"].Value == null || Request.Cookies["CRLocationAr"].Value == null || Request.Cookies["locationId"].Value == null) { return(RedirectToAction("Index", "Home")); } var cRegister = _cashRegisterRepository.GetCashRegister(oid); ViewBag.Location = _locationRepository.GetLocation(cRegister.LocationId).NameAr; var salesman = _salesmanRepository.GetSalesman(cRegister.Salesman); ViewBag.Salesman = salesman.NameAr; ViewBag.SalesmanId = salesman.Sman_Cd; ViewBag.CRLocationEn = Request.Cookies["CRLocationEn"].Value; ViewBag.CRLocationAr = Server.UrlDecode(Request.Cookies["CRLocationAr"].Value); short locationId = short.Parse(Request.Cookies["locationId"].Value); ViewBag.Salesmans = _salesmanRepository.GetSalesmans(locationId); ViewBag.reserveAmount = _locationRepository.GetReserveAmount(locationId); return(View(cRegister)); }
public IActionResult Get(string salesmanId) { var salesman = _repo.GetSalesman(salesmanId); if (salesman == null) { return(NotFound($"ไม่พบ Salesman Id : {salesmanId}")); } return(Ok(salesman)); }