Beispiel #1
0
 public ActionResult Edit([Bind(Include = "id,name,empIdNo,mobile,zoneId,zoneOfficerId,vanDriverId")] tbl_ZoneSuperVisor tbl_zonesupervisor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_zonesupervisor).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.vanDriverId   = new SelectList(db.tbl_VanDriverList, "id", "name", tbl_zonesupervisor.vanDriverId);
     ViewBag.zoneId        = new SelectList(db.tbl_ZoneList, "id", "name", tbl_zonesupervisor.zoneId);
     ViewBag.zoneOfficerId = new SelectList(db.tbl_ZoneOfficerList, "id", "name", tbl_zonesupervisor.zoneOfficerId);
     return(View(tbl_zonesupervisor));
 }
Beispiel #2
0
        // GET: /SuperVisor/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_ZoneSuperVisor tbl_zonesupervisor = db.tbl_ZoneSuperVisor.Find(id);

            if (tbl_zonesupervisor == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_zonesupervisor));
        }
Beispiel #3
0
        public JsonResult DeleteConfirmed(int id)
        {
            string success = string.Empty;
            // return Json(success, JsonRequestBehavior.AllowGet);
            tbl_ZoneSuperVisor tbl_zonesupervisor = db.tbl_ZoneSuperVisor.Find(id);

            db.tbl_ZoneSuperVisor.Remove(tbl_zonesupervisor);
            int result = db.SaveChanges();

            if (result > 0)
            {
                success = "Data delete successfully";
            }
            //  return Json(success, JsonRequestBehavior.AllowGet);

            return(Json(new { result = success }));
        }
Beispiel #4
0
        //public ActionResult Report(string id)
        //{
        //    LocalReport lr = new LocalReport();
        //    string path = Path.Combine(Server.MapPath("~/Report"), "SuperVisorReport.rdlc");
        //    if (System.IO.File.Exists(path))
        //    {
        //        lr.ReportPath = path;
        //    }
        //    else
        //    {
        //        return View("Index");
        //    }
        //    List<tbl_ZoneSuperVisor> cm = new List<tbl_ZoneSuperVisor>();
        //    using (MilkVitaEntities dc = new MilkVitaEntities())
        //    {
        //        cm = dc.tbl_ZoneSuperVisor.ToList();
        //    }
        //    ReportDataSource rd = new ReportDataSource("DataSet1", cm);
        //    lr.DataSources.Add(rd);
        //    string reportType = id;
        //    string mimeType;
        //    string encoding;
        //    string fileNameExtension;



        //    string deviceInfo =

        //    "<DeviceInfo>" +
        //    "  <OutputFormat>" + id + "</OutputFormat>" +
        //    "  <PageWidth>8.5in</PageWidth>" +
        //    "  <PageHeight>11in</PageHeight>" +
        //    "  <MarginTop>0.5in</MarginTop>" +
        //    "  <MarginLeft>1in</MarginLeft>" +
        //    "  <MarginRight>1in</MarginRight>" +
        //    "  <MarginBottom>0.5in</MarginBottom>" +
        //    "</DeviceInfo>";

        //    Warning[] warnings;
        //    string[] streams;
        //    byte[] renderedBytes;

        //    renderedBytes = lr.Render(
        //        reportType,
        //        deviceInfo,
        //        out mimeType,
        //        out encoding,
        //        out fileNameExtension,
        //        out streams,
        //        out warnings);
        //    return File(renderedBytes, mimeType);
        //}

        // GET: /SuperVisor/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_ZoneSuperVisor tbl_zonesupervisor = db.tbl_ZoneSuperVisor.Find(id);

            if (tbl_zonesupervisor == null)
            {
                return(HttpNotFound());
            }
            ViewBag.vanDriverId   = new SelectList(db.tbl_VanDriverList, "id", "name", tbl_zonesupervisor.vanDriverId);
            ViewBag.zoneId        = new SelectList(db.tbl_ZoneList, "id", "name", tbl_zonesupervisor.zoneId);
            ViewBag.zoneOfficerId = new SelectList(db.tbl_ZoneOfficerList, "id", "name", tbl_zonesupervisor.zoneOfficerId);
            return(View(tbl_zonesupervisor));
        }
Beispiel #5
0
        public ActionResult Create([Bind(Include = "id,name,empIdNo,mobile,zoneId,zoneOfficerId,vanDriverId")] tbl_ZoneSuperVisor tbl_zonesupervisor)
        {
            if (ModelState.IsValid)
            {
                db.tbl_ZoneSuperVisor.Add(tbl_zonesupervisor);
                ViewBag.message = "Super Visor Created Succesfully";
                db.SaveChanges();


                //return View(tbl_zonesupervisor);
                return(RedirectToAction("Index"));
            }

            ViewBag.vanDriverId   = new SelectList(db.tbl_VanDriverList, "id", "name", tbl_zonesupervisor.vanDriverId);
            ViewBag.zoneId        = new SelectList(db.tbl_ZoneList, "id", "name", tbl_zonesupervisor.zoneId);
            ViewBag.zoneOfficerId = new SelectList(db.tbl_ZoneOfficerList, "id", "name", tbl_zonesupervisor.zoneOfficerId);
            return(View(tbl_zonesupervisor));
        }