public ActionResult Update(ClientProducer producer)
        {
            var prod = CSDLQLBH.GetSingleProducer(producer.ProducerID);

            prod.ProducerName = producer.ProducerName;
            CSDLQLBH.UpdateProducer(prod);
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
        public static ClientProducer UpdateProducer(ClientProducer producer)
        {
            try
            {
                var endPointString = endPointQLBH + "api/producers";
                var producerUpdate = Task.Run(() => PutAsync <ClientProducer>(endPointString, producer)).Result;

                return(producerUpdate);
            }
            catch (BusinessLayerException)
            {
                throw new BusinessLayerException(500, "#1001002 Không lấy được dữ liệu nhà sản xuất.");
            }
            catch (Exception)
            {
                throw new BusinessLayerException(500, "#1001003 Không lấy được dữ liệu nhà sản xuất.");
            }
        }
 public ActionResult Add(ClientProducer prod)
 {
     //lưu thông tin
     prod = CSDLQLBH.InsertProducer(prod);
     return(RedirectToAction("Index"));
 }