public ActionResult EditDemand(int id, FormCollection formValues)
        {
            Demand demand = demandRepository.FindDemand(id);

            if (TryUpdateModel(demand))
            {
                demandRepository.Save();

                /************** Saving log ***************/

                log.DoAll("Demand: " + demand.No + ", " + demand.Thickness + ", " + demand.Color
                          + ", " + demand.Date + ", " + demand.Quantity + ", " + demand.Size + ", " + demand.OrderNo + ", "
                          + demand.MerchID + ".");

                /*****************************************/

                return(RedirectToAction("DemandDetails", new { id = demand.No }));
            }
            return(View(demand));
        }
Exemple #2
0
        public ActionResult CreateDemand(Demand d)
        {
            if (ModelState.IsValid)
            {
                d.MerchID = Convert.ToInt32(Session["merchID"]);
                d.Date    = DateTime.Now.Date;
                demandRepository.Add(d);

                /************** Saving log ***************/

                log.DoAll("Demand: " + d.No + ", " + d.Thickness + ", " + d.Color
                          + ", " + d.Date + ", " + d.Quantity + ", " + d.Size + ", " + d.OrderNo + ", "
                          + d.MerchID + ".");

                /*****************************************/

                demandRepository.Save();
                return(View("Merch", merchRepository.GetMerchByID(Convert.ToInt32(Session["merchID"]))));
            }
            return(View("~/Views/Home/Error.aspx"));
        }