//Create AssetsLiabilities public int Create(AssetsLiabilities assetsLiabilities) { try { db.Insert_AssetLiability(assetsLiabilities); return(200); } catch (Exception) { return(500); } }
//Get AssetsLiabilities public AssetsLiabilities GetById(Int64 id) { AssetsLiabilities assetsLiabilities = new AssetsLiabilities(); try { return(db.View_AssetLiability(id)); } catch (Exception) { return(assetsLiabilities); } }
public ActionResult Create(AssetsLiabilities assetLiability) { var user = (Users)Session["users"]; assetLiability.IdUser = user.IDUser; int status = assetsLiabilitiesB.Create(assetLiability); if (status == 200) { TempData["message"] = "Add"; return(Json(new { success = true })); } return(View(assetLiability)); }
public IHttpActionResult Post(AssetsLiabilities assetsLiabilities) { int assetsLiabilitie; AssetsLiabilitiesB assetsLiabilitiesB = new AssetsLiabilitiesB(); assetsLiabilitie = assetsLiabilitiesB.CreateCredit(assetsLiabilities); switch (assetsLiabilitie) { case 200: return(Ok(200)); case 500: return(Ok(500)); default: return(Ok(false)); } }
//Create AssetsLiabilities on invoices public int CreateCredit(AssetsLiabilities assetsLiabilities) { try { Check_Payment payment = db.Check_Payment(assetsLiabilities.IdInvoice ?? default(int), assetsLiabilities.Type); Decimal debt = (payment.Total ?? 0) - (payment.Rode ?? 0); if (assetsLiabilities.Rode <= debt) { db.Insert_AssetLiability_Credit(assetsLiabilities); return(200); } else { return(400); } } catch (Exception) { return(500); } }
public ActionResult Assets(int id, AssetsLiabilities assetLiability) { var user = (Users)Session["users"]; assetLiability.IdUser = user.IDUser; assetLiability.IdInvoice = id; assetLiability.Type = true; int status = assetsLiabilitiesB.CreateCredit(assetLiability); if (status == 200) { TempData["message"] = "Asset"; return(Json(new { success = true })); } else if (status == 400) { ModelState.AddModelError("Rode", "Sobre pasa el monto de credito a cancelar"); ViewData["category"] = new SelectList(categoriesB.GetAll(), "IdCategory", "Name"); ViewData["account"] = new SelectList(accountB.GetAll(), "IdAccount", "Name"); return(View(assetLiability)); } return(View(assetLiability)); }
public int Update(AssetsLiabilities input) { return(assetsLiabilityAccess.Update(input)); }
public int CreateCredit(AssetsLiabilities input) { return(assetsLiabilityAccess.CreateCredit(input)); }
//Update AssetsLiabilities public int Update(AssetsLiabilities assetsLiabilities) { return(0); }