public bool InformationSystemUpdateApprove(InformationSystemModel models)
        {
            try
            {
                if (models == null)
                {
                    return(false);
                }
                using (var db = new PORTALEntities())
                {
                    var masterId = models.Id;
                    var list     = (from d in db.InformationSystems where d.Id == masterId select d).FirstOrDefault();
                    list.Solution = models.Solution;
                    list.NumDays  = models.NumDays;
                    list.EmpId    = models.EmpIp;
                    db.SaveChanges();

                    return(true);
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error("ApplicationMasterRepository InformationSystemUpdateApprove: " + ex.Message + " Inner exception: " + ex.InnerException.Message);
                return(false);
            }
        }
        public bool InformationSystemInsert(InformationSystemModel models)
        {
            try
            {
                if (models == null)
                {
                    return(false);
                }
                using (var db = new PORTALEntities())
                {
                    var item = new InformationSystem
                    {
                        MasterId    = models.MasterId,
                        System      = models.System,
                        Seriousness = models.Seriousness,
                        Explanation = models.Explanation
                                      //EmpId = models.EmpIp
                    };

                    db.InformationSystems.Add(item);
                    db.SaveChanges();


                    return(true);
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error("ApplicationMasterRepository InformationSystemInsert Insert: " + ex.Message + " Inner exception: " + ex.InnerException.Message);
                return(false);
            }
        }
Esempio n. 3
0
        public ActionResult InformationSystemUpdate(InformationSystemModel models)
        {
            var rep      = new ApplicationMasterRepository();
            var response = rep.InformationSystemUpdate(models);

            return(Json(response ? new { result = "OK" } : new { result = "ERROR" }));
        }
Esempio n. 4
0
        public ActionResult InformationSystemUpdateApprove(InformationSystemModel models)
        {
            models.EmpIp = User.GetClaimValue(ClaimTypes.Sid);
            var rep      = new ApplicationMasterRepository();
            var response = rep.InformationSystemUpdateApprove(models);

            return(Json(response ? new { result = "OK" } : new { result = "ERROR" }));
        }