コード例 #1
0
        public ActionResult EditMaterial(int MatId)
        {
            var x = (from y in con.Materials
                     where y.MaterialId == MatId
                     select y).FirstOrDefault();

            itmmMaterial a = new itmmMaterial();

            a.Name        = x.Name;
            a.Description = x.Description;
            a.Quantity    = x.Quantity;
            return(View(a));
        }
コード例 #2
0
        public ActionResult EditMaterial(int MatId, itmmMaterial a)
        {
            var b = (from y in con.Materials
                     where y.MaterialId == MatId
                     select y).FirstOrDefault();


            b.Name        = a.Name;
            b.Description = a.Description;
            b.Quantity    = a.Quantity;
            b.DateUpdated = DateTime.Now;
            con.SaveChanges();
            return(RedirectToAction("InventoryCost"));
        }
コード例 #3
0
        public ActionResult Material(itmmMaterial a)
        {
            int      labid = getLabId();
            Material b     = new Material();

            b.Name        = a.Name;
            b.Description = a.Description;
            b.Quantity    = a.Quantity;
            b.DateUpdated = DateTime.Now;

            con.AddToMaterials(b);

            Laboratory_Material c = new Laboratory_Material();

            c.LaboratoryId = labid;
            c.MaterialId   = b.MaterialId;
            con.AddToLaboratory_Material(c);

            con.SaveChanges();
            return(RedirectToAction("Material"));
        }