Exemplo n.º 1
0
        public ActionResult Edit(int id, FormCollection collection)
        {
            try
            {
                var costService = new CostService();

                var cost = new BI_K3_Costs()
                {
                    BI_CostID = int.Parse(collection["BI_CostID"]),
                    Role_Type = collection["role_type"],
                    Role_Name = collection["role_name"]
                };
                if (collection["daily_cost"] != null)
                {
                    cost.Daily_Cost = decimal.Parse(collection["daily_cost"]);
                }
                if (collection["hourly_cost"] != null)
                {
                    cost.Hourly_Cost = decimal.Parse(collection["hourly_cost"]);
                }
                costService.UpdateCost(cost);
                return(RedirectToAction("Index"));
            }
            catch (Exception exception)
            {
                return(View());
            }
        }
Exemplo n.º 2
0
 public void InsertCost(BI_K3_Costs cost)
 {
     if (cost == null)
     {
         throw new ArgumentNullException("cost");
     }
     _costRepository.Insert(cost);
 }
Exemplo n.º 3
0
 public void UpdateCost(BI_K3_Costs cost)
 {
     if (cost == null)
     {
         throw new ArgumentNullException("cost");
     }
     _costRepository.Update(cost);
 }