Beispiel #1
0
 public static void Init()
 {
     Mod       = new ModuleMaster();
     Dic       = new DictionMaster();
     Area      = new AreaMaster();
     Track     = new TrackMaster();
     Device    = new DeviceMaster();
     Goods     = new GoodsMaster();
     Warn      = new WarningMaster();
     TileTrack = new TileTrackMaster();
     Role      = new RoleMaster();
     PreStart();
 }
Beispiel #2
0
 public ActionResult EditGoods(int id, GoodsMaster goodsMaster)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.Entry(goodsMaster).State = EntityState.Modified;
             db.SaveChanges();
             return(RedirectToAction("GoodsList"));
         }
         ViewData["GoodsTypeID"] = new SelectList(db.GoodsTypeMasters.ToList(), "TypeID", "TypeName");
         return(View());
     }
     catch
     {
         return(View());
     }
 }
Beispiel #3
0
 public ActionResult DeleteGoods(int id)
 {
     try
     {
         if (id != null)
         {
             GoodsMaster goodsMaster = db.GoodsMasters.Find(id);
             db.GoodsMasters.Remove(goodsMaster);
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
         else
         {
             return(View());
         }
     }
     catch
     {
         return(View());
     }
 }
Beispiel #4
0
        public ActionResult CreateGoods(GoodsMaster goodsMaster)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    goodsMaster.CreateDate  = DateTime.Now;
                    goodsMaster.UpdatedDate = DateTime.Now;
                    goodsMaster.Createdby   = 1;
                    db.GoodsMasters.Add(goodsMaster);
                    db.SaveChanges();
                    return(RedirectToAction("GoodsList"));
                }

                ViewData["GoodsTypeID"] = new SelectList(db.GoodsTypeMasters.ToList(), "TypeID", "TypeName");
                return(View());
            }
            catch
            {
                return(View());
            }
        }