コード例 #1
0
        // GET: InvCarGateControls/Create
        public ActionResult Create(int?control)
        {
            InvCarGateControl invcar = new InvCarGateControl();

            if (control == null)
            {
                invcar.In_Out_flag = 1; //gate out
            }
            else
            {
                invcar.In_Out_flag = (int)control;
            }

            invcar.dtControl = DateTime.Now;

            var invItems = db.InvItems.Where(s => s.ViewLabel == "UNIT").Select(
                s => new SelectListItem
            {
                Value = s.Id.ToString(),
                Text  = s.ItemCode.ToString() + " - " + s.Description
            }
                );

            ViewBag.recordType = invcar.In_Out_flag == 1 ? "Out" : "In";
            ViewBag.InvItemId  = new SelectList(invItems, "Value", "Text");
            return(View(invcar));
        }
コード例 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            InvCarGateControl invCarGateControl = db.InvCarGateControls.Find(id);

            db.InvCarGateControls.Remove(invCarGateControl);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "Id,InvItemId,In_Out_flag,Odometer,dtControl,Remarks,Driver,Inspector")] InvCarGateControl invCarGateControl)
 {
     if (ModelState.IsValid)
     {
         db.Entry(invCarGateControl).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.InvItemId = new SelectList(db.InvItems, "Id", "ItemCode", invCarGateControl.InvItemId);
     return(View(invCarGateControl));
 }
コード例 #4
0
        // GET: InvCarGateControls/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            InvCarGateControl invCarGateControl = db.InvCarGateControls.Find(id);

            if (invCarGateControl == null)
            {
                return(HttpNotFound());
            }
            return(View(invCarGateControl));
        }
コード例 #5
0
        // GET: InvCarGateControls/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            InvCarGateControl invCarGateControl = db.InvCarGateControls.Find(id);

            if (invCarGateControl == null)
            {
                return(HttpNotFound());
            }
            ViewBag.InvItemId = new SelectList(db.InvItems, "Id", "ItemCode", invCarGateControl.InvItemId);
            return(View(invCarGateControl));
        }