예제 #1
0
 public ActionResult DeleteConfirmed(int id)
 {
     try {
         tbl_SR_allocation tbl_SR_allocation = db.tbl_SR_allocation.Find(id);
         db.tbl_SR_allocation.Remove(tbl_SR_allocation);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         ViewBag.Er = ex.Message.ToString();
         return(View("ErrorMsg"));
     }
 }
예제 #2
0
        public ActionResult Create([Bind(Include = "sr_id,sender_id,receiver_id,tbldatakey_id,receiver_key")] tbl_SR_allocation tbl_SR_allocation)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    d.SaveSRAllocation(tbl_SR_allocation);
                    return(RedirectToAction("Index"));
                }

                return(View(tbl_SR_allocation));
            }
            catch (Exception ex)
            {
                ViewBag.Er = ex.Message.ToString();
                return(View("ErrorMsg"));
            }
        }
예제 #3
0
 public ActionResult Edit([Bind(Include = "sr_id,sender_id,receiver_id,tbldatakey_id,receiver_key")] tbl_SR_allocation tbl_SR_allocation)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.Entry(tbl_SR_allocation).State = EntityState.Modified;
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
         return(View(tbl_SR_allocation));
     }
     catch (Exception ex)
     {
         ViewBag.Er = ex.Message.ToString();
         return(View("ErrorMsg"));
     }
 }
예제 #4
0
 // GET: SRAllocation/Edit/5
 public ActionResult Edit(int?id)
 {
     try
     {
         if (id == null)
         {
             return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
         }
         tbl_SR_allocation tbl_SR_allocation = db.tbl_SR_allocation.Find(id);
         if (tbl_SR_allocation == null)
         {
             return(HttpNotFound());
         }
         return(View(tbl_SR_allocation));
     }
     catch (Exception ex)
     {
         ViewBag.Er = ex.Message.ToString();
         return(View("ErrorMsg"));
     }
 }