public ActionResult CreateEdit(int ID) { INTGSTBL Obj = new INTGSTBL(); if (ID > 0) { Obj = Obj.GetOne(ID); Obj.iNTItems = INTItems.GetAll(ID); } else { Obj.iNTItems.Add(new INTItems { IParentId = ID, IQty = 0, ItemID = 0, IUnitID = 0 }); } return(View(Obj)); }
public ActionResult CreateEdit(INTGSTBL Obj) { if (Obj.Typeid == 1) { if (Obj.Qty == 0) { return(Json(new { msg = "Opening Stock Required" })); } } int i = Obj.Save(); foreach (var Subitem in Obj.iNTItems) { Subitem.IParentId = Obj.GSID; Subitem.Save(); } if (i > 0) { return(Json(new { data = Obj }, JsonRequestBehavior.AllowGet)); } return(RedirectToAction("Error")); }
// GET: INTGSTBL public ActionResult Index() { List <INTGSTBL> listINTGSTBL = INTGSTBL.GetAll(); return(View(listINTGSTBL)); }