Пример #1
0
        public ActionResult saveuser(int id, string propertyName, string value)
        {
            var status  = false;
            var message = "";

            //Update data to database

            using (sithar_dbEntities1 dc = new sithar_dbEntities1())
            {
                var user = dc.ConstructorRequests.Find(id);
                if (user != null)
                {
                    dc.Entry(user).Property(propertyName).CurrentValue = value;
                    dc.SaveChanges();
                    status = true;
                }
                else
                {
                    message = "Error!";
                }
            }

            var     response = new { value = value, status = status, message = message };
            JObject o        = JObject.FromObject(response);

            return(Content(o.ToString()));
        }
Пример #2
0
        public ActionResult UpdateSupplier(int id, Supplier sup)
        {
            try
            {
                using (sithar_dbEntities1 db = new sithar_dbEntities1())
                {
                    db.Entry(sup).State = System.Data.Entity.EntityState.Modified;
                    db.SaveChanges();
                }
                // TODO: Add update logic here

                return(RedirectToAction("getSuppliers"));
            }
            catch
            {
                return(View());
            }
        }
Пример #3
0
        public ActionResult UpdatePolicy(int id, Policy pol)
        {
            try
            {
                using (sithar_dbEntities1 db = new sithar_dbEntities1())
                {
                    db.Entry(pol).State = System.Data.Entity.EntityState.Modified;
                    db.SaveChanges();
                }
                // TODO: Add update logic here

                return(RedirectToAction("Policies"));
            }
            catch
            {
                return(View());
            }
        }
Пример #4
0
        public ActionResult UpdateSiteItemQty(int id, SiteItemQuantity siq)
        {
            try
            {
                using (sithar_dbEntities1 db = new sithar_dbEntities1())
                {
                    db.Entry(siq).State = System.Data.Entity.EntityState.Modified;
                    db.SaveChanges();
                }
                // TODO: Add update logic here

                return(RedirectToAction("SiteItemQty"));
            }
            catch
            {
                return(View());
            }
        }
Пример #5
0
        public ActionResult EditLog(int id, Log log)
        {
            try
            {
                using (sithar_dbEntities1 db = new sithar_dbEntities1())
                {
                    db.Entry(log).State = System.Data.Entity.EntityState.Modified;
                    db.SaveChanges();
                }
                // TODO: Add update logic here

                return(RedirectToAction("getLogs"));
            }
            catch
            {
                return(View());
            }
        }
Пример #6
0
        public ActionResult UpdateEmployee(int id, AuthEmployee emp)
        {
            try
            {
                using (sithar_dbEntities1 db = new sithar_dbEntities1())
                {
                    db.Entry(emp).State = System.Data.Entity.EntityState.Modified;
                    db.SaveChanges();
                }
                // TODO: Add update logic here

                return(RedirectToAction("Initial"));
            }
            catch
            {
                return(View());
            }
        }
Пример #7
0
        public ActionResult UpdateRequest(int id, ConstructorRequest cq)
        {
            try
            {
                using (sithar_dbEntities1 db = new sithar_dbEntities1())
                {
                    db.Entry(cq).State = System.Data.Entity.EntityState.Modified;
                    db.SaveChanges();
                }
                // TODO: Add update logic here

                return(RedirectToAction("getConRequest"));
            }
            catch
            {
                return(View());
            }
        }