Esempio n. 1
0
 public JsonResult GetTableModelData()
 {
     try
     {
         using (E3_Components_Symbols_EditEntities db = new E3_Components_Symbols_EditEntities())
         {
             DateTime controlDate = DateTime.Now.AddDays(-90);
             db.Configuration.ProxyCreationEnabled = false;
             db.Configuration.LazyLoadingEnabled   = false;
             var query = db.ModelData.AsNoTracking().ToList();
             var data  = query.Select(dataList => new
             {
                 editLink = "<td><a href=" + '\u0022' + "#" + '\u0022' + " onclick=" + '\u0022' + "return PostModel('" + dataList.ID + "')" + '\u0022' + "><span class=" + '\u0022' + "glyphicon glyphicon-alert" + '\u0022' + "></span></a></td>",
                 dataList.ID,
                 dataList.Entry,
                 dataList.Type,
                 dataList.Class,
                 dataList.Description,
                 LASTUPDT   = JsonConvert.SerializeObject(dataList.LASTUPDT, shortDefaultSetting).Replace(@"""", ""),
                 DATEMAIN   = JsonConvert.SerializeObject(dataList.DATEMAIN, shortDefaultSetting).Replace(@"""", ""),
                 removeLink = "<td><a href=" + '\u0022' + "#" + '\u0022' + " onclick=" + '\u0022' + "return RemoveModel('" + dataList.ID + "')" + '\u0022' + "><span class=" + '\u0022' + "glyphicon glyphicon-remove" + '\u0022' + "></span></a></td>",
                 note       = GetNoteModelData(dataList)
             });
             logger.Debug("E3SeriesController / GetTableModelData");
             return(Json(new { data }));
         }
     }
     catch (Exception ex)
     {
         logger.Error("E3SeriesController / GetTableModelData: " + " | " + ex);
         return(Json(0, JsonRequestBehavior.AllowGet));
     }
 }
Esempio n. 2
0
 public JsonResult GetTableComponentData()
 {
     try
     {
         using (E3_Components_Symbols_EditEntities db = new E3_Components_Symbols_EditEntities())
         {
             DateTime controlDate = DateTime.Now.AddDays(-90);
             db.Configuration.ProxyCreationEnabled = false;
             db.Configuration.LazyLoadingEnabled   = false;
             var query = db.ComponentData.AsNoTracking().ToList();
             var data  = query.Select(dataList => new
             {
                 editLink = "<td><a href=" + '\u0022' + "#" + '\u0022' + " onclick=" + '\u0022' + "return PostComponent('" + dataList.ID + "')" + '\u0022' + "><span class=" + '\u0022' + "glyphicon glyphicon-alert" + '\u0022' + "></span></a></td>",
                 dataList.ID,
                 dataList.ENTRY,
                 dataList.VERSION,
                 dataList.DeviceLetterCode,
                 dataList.Class,
                 dataList.ENTRYTYP,
                 dataList.Description,
                 dataList.LPNTR,
                 dataList.VSTATUS,
                 dataList.VersionText,
                 LASTUPDT = JsonConvert.SerializeObject(dataList.LASTUPDT, shortDefaultSetting).Replace(@"""", ""),
                 DATEMAIN = JsonConvert.SerializeObject(dataList.DATEMAIN, shortDefaultSetting).Replace(@"""", ""),
                 dataList.MPNTR,
                 dataList.Flags,
                 dataList.ArticleNumber,
                 dataList.Supplier,
                 dataList.SPNTR,
                 dataList.Class_main,
                 dataList.katek_1C,
                 dataList.katek_type_rkd,
                 dataList.katek_name_rkd,
                 removeLink = "<td><a href=" + '\u0022' + "#" + '\u0022' + " onclick=" + '\u0022' + "return RemoveComponent('" + dataList.ID + "')" + '\u0022' + "><span class=" + '\u0022' + "glyphicon glyphicon-remove" + '\u0022' + "></span></a></td>",
                 note       = GetNoteComponentData(dataList)
             });
             logger.Debug("E3SeriesController / GetTableComponentData");
             return(Json(new { data }));
         }
     }
     catch (Exception ex)
     {
         logger.Error("E3SeriesController / GetTableComponentData: " + " | " + ex);
         return(Json(0, JsonRequestBehavior.AllowGet));
     }
 }
Esempio n. 3
0
        public JsonResult PostSymbol(string ID)
        {
            string login = HttpContext.User.Identity.Name;

            try
            {
                using (E3_Components_Symbols_EditEntities db = new E3_Components_Symbols_EditEntities())
                {
                    db.Configuration.ProxyCreationEnabled = false;
                    db.Configuration.LazyLoadingEnabled   = false;
                    var model = db.SymbolData.First(a => a.ID == ID);
                    new EmailE3(login, "Просьба срочно добавить/изменить символ: " + model.ENTRY);
                    logger.Debug("E3SeriesController / PostComponent");
                    return(Json(1, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                logger.Error("E3SeriesController / PostComponent: " + " | " + ex);
                return(Json(0, JsonRequestBehavior.AllowGet));
            }
        }