public ActionResult GetDetails(long id)
 {
     try
     {
         Session["id"] = id;
         Models.APIUserModel cm = new Models.APIUserModel();
         if (id != 0)
         {
             CLayer.APIPriceMarkup usr = BLayer.APIPriceMarkup.Get(id);
             if (usr != null)
             {
                 cm.APIPriceMarkupCode = usr.APIPriceMarkupCode;
                 cm.CustomerId         = usr.CustomerId;
                 cm.CustomerName       = usr.CustomerName;
                 cm.DescriptionId      = usr.DescriptionId;
                 cm.SellPrice          = usr.SellMarkup;
             }
         }
         return(View("_Details", cm));
     }
     catch (Exception ex)
     {
         Common.LogHandler.HandleError(ex);
         Redirect("~/ErrorPage");
     }
     return(View());
 }
Esempio n. 2
0
 public ActionResult SaveDetails(Models.APIUserModel data)
 {
     try
     {
         CLayer.APIPriceMarkup API = new CLayer.APIPriceMarkup();
         {
             API.APIPriceMarkupCode = data.APIPriceMarkupCode;
             API.SellMarkup         = data.SellPrice;
         };
         BLayer.APIPriceMarkup.SaveNewAPIMarkup(API);
     }
     catch (Exception ex)
     {
         Common.LogHandler.HandleError(ex);
     }
     return(RedirectToAction("Index"));
 }