public ActionResult DeleteConfirmed(int id)
        {
            AllocationGroup allocationgroupmaster = db.AllocationGroups.Find(id);

            db.AllocationGroups.Remove(allocationgroupmaster);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult Create([Bind(Include = "AllocationGroupID,Name")] AllocationGroup allocationgroupmaster)
        {
            if (ModelState.IsValid)
            {
                db.AllocationGroups.Add(allocationgroupmaster);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(allocationgroupmaster));
        }
        // GET: /AllocationGroup/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AllocationGroup allocationgroupmaster = db.AllocationGroups.Find(id);

            if (allocationgroupmaster == null)
            {
                return(HttpNotFound());
            }
            return(View(allocationgroupmaster));
        }
        public ActionResult _EditFor([Bind(Include = "AllocationGroupID,Name")] AllocationGroup allocationgroupmaster)
        {
            string msg = "Error in processing.";

            if (ModelState.IsValid)
            {
                allocationgroupmaster.Name            = allocationgroupmaster.Name.ToUpper();
                db.Entry(allocationgroupmaster).State = EntityState.Modified;
                db.SaveChanges();

                ModelState.Clear();
                msg = "Successfully created.";

                return(RedirectToAction("_GroupPartial", "BankVoucherDetailAllocation", new { id = allocationgroupmaster.AllocationGroupID }));
            }
            return(Json(msg, JsonRequestBehavior.AllowGet));
        }
 public ActionResult Edit([Bind(Include = "AllocationGroupID,Name")] AllocationGroup allocationgroupmaster)
 {
     Session["err"] = "Error, Please Check Input Fields";
     Session["msg"] = "";
     if (ModelState.IsValid)
     {
         db.Entry(allocationgroupmaster).State = EntityState.Modified;
         db.SaveChanges();
         Session["err"] = "";
         Session["msg"] = "Modified Successfully";
         return(RedirectToAction("Index"));
     }
     ViewBag.Error  = Session["err"];
     Session["err"] = "";
     Session["msg"] = "";
     return(View(allocationgroupmaster));
 }
        public JsonResult GetGroup(int id)
        {
            AllocationGroup allocationgroupmaster = db.AllocationGroups.Find(id);

            return(Json(allocationgroupmaster.Name, JsonRequestBehavior.AllowGet));
        }