当前位置: 首页>>代码示例>>C#>>正文


C# DataModels.InfoManageDataContext类代码示例

本文整理汇总了C#中InfoManage.DataModels.InfoManageDataContext的典型用法代码示例。如果您正苦于以下问题:C# InfoManageDataContext类的具体用法?C# InfoManageDataContext怎么用?C# InfoManageDataContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


InfoManageDataContext类属于InfoManage.DataModels命名空间,在下文中一共展示了InfoManageDataContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AjaxBatteryStatus

 public ActionResult AjaxBatteryStatus()
 {
     try
     {
         using (InfoManageDataContext infocontext = new InfoManageDataContext())
         {
             using (webmeteo_g2DataContext context = new webmeteo_g2DataContext())
             {
                 List<DATA_STAB_InfoManage> stations = context.DATA_STAB_InfoManages.Where(c => c.CREATE_DATE.Year.Equals(DateTime.Now.Year) && c.CREATE_DATE.Month.Equals(DateTime.Now.Month) && c.CREATE_DATE.Day.Equals(DateTime.Now.Day) && c.CREATE_DATE.Hour.Equals(DateTime.Now.Hour)).ToList<DATA_STAB_InfoManage>();
                 List<dynamic> res = new List<dynamic>();
                 foreach (DATA_STAB_InfoManage battery in stations)
                 {
                     AWS_InfoManage aws = context.AWS_InfoManages.Where(c => c.STATION_NUMBER.Equals(battery.STATION_NUMBER)).FirstOrDefault();
                     if (aws != null)
                     {
                         Station infosta = infocontext.Stations.Where(c => c.StationNum.Equals(battery.STATION_NUMBER)).FirstOrDefault();
                         if (infosta != null)
                         {
                             //StationEquipmentsOnline online = infocontext.StationEquipmentsOnlines.Where(c => c.StationID.Equals(infosta.StationID) && c.ElementID.Equals(29)).FirstOrDefault();
                             var VOLTAGE = ((int)(battery.MB_VOLTAGE * 10)) / 10.0;
                             var TEMP = ((int)(battery.AWS_TEMP * 10)) / 10.0;
                             res.Add(new { SolerBord = "XS500", VaildDate = DateTime.Now.AddYears(3), SIM = infosta.SIM, StationTyp = infosta.StationType, STATION_NAME = aws.STATION_NAME, STATION_NUMBER = battery.STATION_NUMBER, VOLTAGE = VOLTAGE });
                         }
                     }
                 }
                 return Json(res, JsonRequestBehavior.AllowGet);
             }
         }
     }
     catch
     {
         return Json("", JsonRequestBehavior.AllowGet);
     }
 }
开发者ID:MadIHI,项目名称:InfoManage,代码行数:34,代码来源:MonitorStationController.cs

示例2: AjaxGetInfoStatistics

        public ActionResult AjaxGetInfoStatistics(string InfoStatisticsStartDate, string InfoStatisticsEndDate)
        {
            try
            {
                using (InfoManageDataContext context = new InfoManageDataContext())
                {
                    DateTime dateInfoStatisticsStartDate = DateTime.ParseExact(InfoStatisticsStartDate, AllConsts.HOUR_MINUTE, System.Globalization.DateTimeFormatInfo.CurrentInfo);
                    DateTime dateInfoStatisticsEndDate = DateTime.ParseExact(InfoStatisticsEndDate, AllConsts.HOUR_MINUTE, System.Globalization.DateTimeFormatInfo.CurrentInfo);

                    int stationMaintence = context.StationEquipmentsMaintenances.Where(c => c.MaintenanceDate < dateInfoStatisticsEndDate && c.MaintenanceDate > dateInfoStatisticsStartDate).Count();
                    int stationRepair = context.StationEquipmentsRepairs.Where(c => c.FaultEndDate < dateInfoStatisticsEndDate && c.FaultEndDate > dateInfoStatisticsStartDate).Count();
                    int systemMaintence = context.SystemMaintances.Where(c => c.MaintenanceDate < dateInfoStatisticsEndDate && c.MaintenanceDate > dateInfoStatisticsStartDate).Count();
                    int systemRepair = context.SystemRepairs.Where(c => c.RepairDate < dateInfoStatisticsEndDate && c.RepairDate > dateInfoStatisticsStartDate).Count();
                    int vidoConference = context.VideoConferenceMaintenances.Where(c => c.ConferenceDate < dateInfoStatisticsEndDate && c.ConferenceDate > dateInfoStatisticsStartDate).Count();
                    int networkMaintence = context.NetWorkMaintances.Where(c => c.MaintenanceDate < dateInfoStatisticsEndDate && c.MaintenanceDate > dateInfoStatisticsStartDate).Count();
                    int networkRepair = context.NetWorkRepairs.Where(c => c.FaultEndDate < dateInfoStatisticsEndDate && c.FaultEndDate > dateInfoStatisticsStartDate).Count();
                    List<dynamic> res = new List<dynamic>();
                    res.Add(new { stationMaintence, stationRepair, systemMaintence, systemRepair, vidoConference, networkMaintence, networkRepair });
                    return Json(res, JsonRequestBehavior.AllowGet);
                }
            }
            catch
            {
                return Json("", JsonRequestBehavior.AllowGet);
            }
        }
开发者ID:MadIHI,项目名称:InfoManage,代码行数:26,代码来源:EquipmentManagementController.cs

示例3: AjaxGetSoftWareShareList

 public ActionResult AjaxGetSoftWareShareList(int flag)
 {
     List<SoftShare> res = new List<SoftShare>();
     try
     {
         using (InfoManageDataContext context = new InfoManageDataContext())
         {
             SqlParameter[] parames = new SqlParameter[1];
             SqlParameter filetype = new SqlParameter();
             filetype.ParameterName = "@FileType";
             filetype.SqlDbType = System.Data.SqlDbType.VarChar;
             filetype.Size = 25;
             filetype.Value = AllConsts.getSoftSahreType(flag);
             parames[0] = filetype;
             AllUNCPath result = context.Database.SqlQuery<AllUNCPath>("EXEC [dbo].[sp_SYS_GetUNCPath] @FileType", parames).FirstOrDefault();
             string filePath = Path.Combine(result.UNCPath, "");
             DirectoryInfo tmp = new DirectoryInfo(filePath);
             if (tmp.Exists)
             {
                 FileInfo[] allfiles = tmp.GetFiles();
                 Array.Sort(allfiles, new FileSort(FileOrder.LastAccessTime, FileAsc.Desc)); //按修改日期升序排列
                 foreach (FileInfo file in allfiles)
                 {
                     string[] tmpfilename = file.Name.Split(AllConsts.cookieEnd.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                     if (tmpfilename.Length == 3)
                     {
                         SoftShare share = new SoftShare();
                         share.FileType = AllConsts.getSoftSahreType(flag);
                         share.Share = tmpfilename[0];
                         share.SoftName = tmpfilename[2];
                         share.envirnments = tmpfilename[1];
                         share.SoftSize = (int)file.Length;
                         share.UpDateDate = file.LastWriteTime;
                         res.Add(share);
                     }
                 }
             }
             return Json(res, JsonRequestBehavior.AllowGet);
         }
     }
     catch
     {
         return Json(res, JsonRequestBehavior.AllowGet);
     }
     //try
     //{
     //    using (InfoManageDataContext context = new InfoManageDataContext())
     //    {
     //        int belonging = int.Parse(flag);
     //        resultautostaion = context.SoftShares.Where(c => c.Belonging.Equals(belonging)).ToList<SoftShare>();
     //    }
     //    return Json(resultautostaion, JsonRequestBehavior.AllowGet);
     //}
     //catch
     //{
     //    return Json(resultautostaion, JsonRequestBehavior.AllowGet);
     //}
 }
开发者ID:MadIHI,项目名称:InfoManage,代码行数:58,代码来源:SoftWareShareController.cs

示例4: addStationAtmosphericComposition

 public ActionResult addStationAtmosphericComposition(string StationNum,
  string StationBuildDate,
  string StationName,
  int StoragesInfoID,
  int transportManageType,
  string StationType,
  string StationManufacturer,
  string StationLongitude,
  string StationLatitude,
  string StationAltitude,
  string Operator)
 {
     try
     {
         using (InfoManageDataContext context = new InfoManageDataContext())
         {
             AtmosphericCompositionStation result = context.AtmosphericCompositionStations.Where(c => c.StationNum.Equals(StationNum)).FirstOrDefault();
             if (result == null)
             {
                 AtmosphericCompositionStation newstation = new AtmosphericCompositionStation();
                 newstation.StationNum = StationNum;
                 newstation.StationBuildDate = DateTime.ParseExact(StationBuildDate, AllConsts.HOUR_MINUTE, System.Globalization.DateTimeFormatInfo.CurrentInfo);
                 newstation.StationName = StationName;
                 newstation.StoragesInfoID = StoragesInfoID;
                 newstation.transportManageType = transportManageType;
                 newstation.StationType = StationType;
                 newstation.StationManufacturer = StationManufacturer;
                 newstation.StationLongitude = StationLongitude;
                 newstation.StationLatitude = StationLatitude;
                 newstation.StationAltitude = StationAltitude;
                 newstation.Operator = Operator;
                 context.AtmosphericCompositionStations.Add(newstation);
             }
             else
             {
                 result.StationName = StationName;
                 result.transportManageType = transportManageType;
                 result.StationType = StationType;
                 result.StationManufacturer = StationManufacturer;
                 result.StationLongitude = StationLongitude;
                 result.StationLatitude = StationLatitude;
                 result.StationAltitude = StationAltitude;
                 result.Operator = Operator;
             }
             context.SaveChanges();
             return Json("OK", JsonRequestBehavior.AllowGet);
         }
     }
     catch
     {
         return Json("NO", JsonRequestBehavior.AllowGet);
     }
 }
开发者ID:MadIHI,项目名称:InfoManage,代码行数:53,代码来源:SpetialDeviceController.cs

示例5: AjaxGetNetWorkMaintenanceList

 public ActionResult AjaxGetNetWorkMaintenanceList(int StoragesInfoID)
 {
     try
     {
         using (InfoManageDataContext context = new InfoManageDataContext())
         {
             List<dynamic> list = (from c in context.NetWorkMaintances
                                   join d in context.NetworkEquipments
                                   on c.NetworkEquipmentCode equals d.NetworkEquipmentCode
                                   orderby c.NetWorkMaintanceID descending
                                   select new { c.NetWorkMaintanceID, c.NetworkEquipmentCode, c.Reportor, c.ReportDate, c.MaintenanceDate, d.NetworkEquipmentName, d.NetworkEquipmentType, d.NetworkEquipmentManufacturer, d.NetworkEquipmentProvider }).ToList<dynamic>();
             return Json(list, JsonRequestBehavior.AllowGet);
         }
     }
     catch
     {
         return Json("", JsonRequestBehavior.AllowGet);
     }
 }
开发者ID:MadIHI,项目名称:InfoManage,代码行数:19,代码来源:EquipmentManagementController.cs

示例6: AjaxDellUpRequest

 public ActionResult AjaxDellUpRequest(int UpRequestID)
 {
     try
     {
         using (InfoManageDataContext context = new InfoManageDataContext())
         {
             UpRequest stations123 = context.UpRequests.Where(c => c.UpRequestID.Equals(UpRequestID)).FirstOrDefault();
             if (stations123 != null)
             {
                 context.UpRequests.Remove(stations123);
             }
             context.SaveChanges();
             return Json("OK", JsonRequestBehavior.AllowGet);
         }
     }
     catch
     {
         return Json("NO", JsonRequestBehavior.AllowGet);
     }
 }
开发者ID:MadIHI,项目名称:InfoManage,代码行数:20,代码来源:AdminController.cs

示例7: AjaxGetStationManageList

 public ActionResult AjaxGetStationManageList(string SDate)
 {
     try
     {
         using (InfoManageDataContext context = new InfoManageDataContext())
         {
             DateTime tmpdate = DateTime.ParseExact(SDate + " 00:00", AllConsts.HOUR_MINUTE, System.Globalization.DateTimeFormatInfo.CurrentInfo);
             List<dynamic> results = (from c in context.Stations
                                      where c.LastModifyDate > tmpdate && (c.LastModifier.Equals(AllConsts.adminName))
                                      join d in context.StoragesInfos
                                      on c.StoragesInfoID equals d.StoragesInfoID
                                      select new { c.StationBuildDate, c.StationNum, c.StationName, c.StationAdrass, d.StoragesInfoName }).ToList<dynamic>();
             return Json(results, JsonRequestBehavior.AllowGet);
         }
     }
     catch
     {
         return Json("", JsonRequestBehavior.AllowGet);
     }
 }
开发者ID:MadIHI,项目名称:InfoManage,代码行数:20,代码来源:ManageAdminController.cs

示例8: AjaxUpload

        public ActionResult AjaxUpload(string FileType, string envirnments)
        {
            HttpPostedFileBase upload = Request.Files["upLoadFile"];
            try
            {
                if (Request.Cookies["User"] != null)
                {
                    HttpCookie aCookie = Request.Cookies["User"];
                    string realname = Server.UrlDecode(aCookie["RealName"]);

                    if (upload != null && FileType != null)
                    {
                        if (upload.ContentLength > 0)
                        {
                            using (InfoManageDataContext context = new InfoManageDataContext())
                            {
                                SqlParameter[] parames = new SqlParameter[1];
                                SqlParameter filetype = new SqlParameter();
                                filetype.ParameterName = "@FileType";
                                filetype.SqlDbType = System.Data.SqlDbType.VarChar;
                                filetype.Size = 25;
                                filetype.Value = FileType;
                                parames[0] = filetype;
                                AllUNCPath result = context.Database.SqlQuery<AllUNCPath>("EXEC [dbo].[sp_SYS_GetUNCPath] @FileType", parames).FirstOrDefault();
                                string filePath = Path.Combine(result.UNCPath, realname + AllConsts.cookieEnd + envirnments + AllConsts.cookieEnd + upload.FileName);
                                FileInfo tmp = new FileInfo(filePath);
                                if (tmp.Exists)
                                    tmp.Delete();
                                upload.SaveAs(filePath);
                                return Json("OK", JsonRequestBehavior.AllowGet);
                            }
                        }
                    }
                }
            }
            catch
            {
                return Json("NO", JsonRequestBehavior.AllowGet);
            }
            return Json("NO", JsonRequestBehavior.AllowGet);
        }
开发者ID:MadIHI,项目名称:InfoManage,代码行数:41,代码来源:FileUploadController.cs

示例9: AjaxGetNetWorkMaintanceDetails

 public ActionResult AjaxGetNetWorkMaintanceDetails(int NetWorkMaintanceID)
 {
     try
     {
         using (InfoManageDataContext context = new InfoManageDataContext())
         {
             NetWorkMaintance result = context.NetWorkMaintances.Find(NetWorkMaintanceID);
             if (result != null)
             {
                 NetworkEquipment station = context.NetworkEquipments.Where(c => c.NetworkEquipmentCode.Equals(result.NetworkEquipmentCode)).FirstOrDefault();
                 if (station != null)
                     return Json(new { NetworkEquipmentCode = station.NetworkEquipmentCode, NetworkEquipmentName = station.NetworkEquipmentName, NetworkEquipmentType = station.NetworkEquipmentType, NetworkEquipmentManufacturer = station.NetworkEquipmentManufacturer, NetworkEquipmentCategory = station.NetworkEquipmentCategory, NetWorkDeviceUsage = station.NetWorkDeviceUsage, ReportDate = result.ReportDate, Reportor = result.Reportor, MaintenanceDate = result.MaintenanceDate, MaintenanceDescription = result.MaintenanceDescription, Maintenner = result.Maintenner, NetWorkMaintanceID = result.NetWorkMaintanceID }, JsonRequestBehavior.AllowGet);
             }
             return Json("", JsonRequestBehavior.AllowGet);
         }
     }
     catch
     {
         return Json("", JsonRequestBehavior.AllowGet);
     }
 }
开发者ID:MadIHI,项目名称:InfoManage,代码行数:21,代码来源:EquipmentManagementController.cs

示例10: AjaxGetEquipmentManageList

 public ActionResult AjaxGetEquipmentManageList(string SDate)
 {
     try
     {
         using (InfoManageDataContext context = new InfoManageDataContext())
         {
             DateTime tmpdate = DateTime.ParseExact(SDate + " 00:00", AllConsts.HOUR_MINUTE, System.Globalization.DateTimeFormatInfo.CurrentInfo);
             List<EquipmentsStorage> equipments = context.EquipmentsStorages.Where(c => c.LastModifyDate > tmpdate && (c.LastModifier.Equals(AllConsts.adminName))).ToList<EquipmentsStorage>();
             List<dynamic> results = new List<dynamic>();
             foreach (EquipmentsStorage equip in equipments)
             {
                 Element storage = context.Elements.Where(c => c.ElementID.Equals(equip.ElementID)).FirstOrDefault();
                 results.Add(new { equip.LastModifyDate, ElementID = equip.ElementID, SparePartsName = storage.SparePartsName, ApplicableModels = equip.ApplicableModels, CheckDate = equip.CheckDate, Operator = equip.Operator, SparePartsBelongingStatus = equip.SparePartsBelongingStatus, SparePartsCode = equip.SparePartsCode, SparePartsManufacturer = equip.SparePartsManufacturer, SparePartsStatus = equip.SparePartsStatus, SparePartsType = equip.SparePartsType, TurnInDate = equip.TurnInDate, VaildDate = equip.VaildDate });
             }
             return Json(results, JsonRequestBehavior.AllowGet);
         }
     }
     catch
     {
         return Json("", JsonRequestBehavior.AllowGet);
     }
 }
开发者ID:MadIHI,项目名称:InfoManage,代码行数:22,代码来源:ManageAdminController.cs

示例11: AjaxAtmosphericCompositionStation

 public ActionResult AjaxAtmosphericCompositionStation()
 {
     try
     {
         using (InfoManageDataContext context = new InfoManageDataContext())
         {
             List<dynamic> res = new List<dynamic>();
             List<AtmosphericCompositionStation> atmosphericStation = context.AtmosphericCompositionStations.ToList<AtmosphericCompositionStation>();
             foreach (AtmosphericCompositionStation sta in atmosphericStation)
             {
                 string StationLongitude = sta.StationLongitude;
                 string StationLatitude = sta.StationLatitude;
                 double longitude = int.Parse(StationLongitude.Substring(0, 3)) + int.Parse(StationLongitude.Substring(3, 2)) / 60.0 + int.Parse(StationLongitude.Substring(5, 2)) / 3600.0;
                 double latitude = int.Parse(StationLatitude.Substring(0, 2)) + int.Parse(StationLatitude.Substring(2, 2)) / 60.0 + int.Parse(StationLatitude.Substring(4, 2)) / 3600.0;
                 res.Add(new { StationType = (int)AllConsts.SPETIALSTATION_TYPE.AtmosphericCompositionStation, StationTypeName = AllConsts.getSpetialStationType((int)AllConsts.SPETIALSTATION_TYPE.AtmosphericCompositionStation), sta.StationNum, sta.StationName, StationLongitude = longitude.ToString(), StationLatitude = latitude.ToString() });
             }
             return Json(res, JsonRequestBehavior.AllowGet);
         }
     }
     catch
     {
         return Json("", JsonRequestBehavior.AllowGet);
     }
 }
开发者ID:MadIHI,项目名称:InfoManage,代码行数:24,代码来源:MonitorStationController.cs

示例12: AjaxStationEquipmentsMaintenanceAdd

 public ActionResult AjaxStationEquipmentsMaintenanceAdd(string RegionName, int StoragesInfoID, string StationNum, string StationClass, string StationType, string StationManufacturer, string MaintenanceDescription, string Maintenner, string MaintenanceDate, bool powerSta, bool communicationSta, bool samplingSta, bool senserSta, bool cleaningSta, bool stableSta, string Reportor, string ReportDate, string MaintenanceCommants)
 {
     try
     {
         using (InfoManageDataContext context = new InfoManageDataContext())
         {
             DateTime MaintenanceDatetmp = DateTime.ParseExact(MaintenanceDate, AllConsts.HOUR_MINUTE, System.Globalization.DateTimeFormatInfo.CurrentInfo);
             StationEquipmentsMaintenance newStationEquipmentsMaintenance = new StationEquipmentsMaintenance();
             newStationEquipmentsMaintenance.RegionName = RegionName;
             newStationEquipmentsMaintenance.StoragesInfoID = StoragesInfoID;
             newStationEquipmentsMaintenance.StationNum = StationNum;
             newStationEquipmentsMaintenance.MaintenanceDescription = MaintenanceDescription;
             newStationEquipmentsMaintenance.Maintenner = Maintenner;
             newStationEquipmentsMaintenance.MaintenanceDate = DateTime.ParseExact(MaintenanceDate, AllConsts.HOUR_MINUTE, System.Globalization.DateTimeFormatInfo.CurrentInfo);
             newStationEquipmentsMaintenance.powerSta = powerSta;
             newStationEquipmentsMaintenance.communicationSta = communicationSta;
             newStationEquipmentsMaintenance.samplingSta = samplingSta;
             newStationEquipmentsMaintenance.senserSta = senserSta;
             newStationEquipmentsMaintenance.cleaningSta = cleaningSta;
             newStationEquipmentsMaintenance.stableSta = stableSta;
             newStationEquipmentsMaintenance.Reportor = Reportor;
             newStationEquipmentsMaintenance.ReportDate = DateTime.ParseExact(ReportDate, AllConsts.HOUR_MINUTE, System.Globalization.DateTimeFormatInfo.CurrentInfo);
             newStationEquipmentsMaintenance.MaintenanceCommants = MaintenanceCommants;
             StationEquipmentsMaintenance result = context.StationEquipmentsMaintenances.Where(c => c.StationNum.Equals(StationNum) && c.MaintenanceDate.Equals(MaintenanceDatetmp)).FirstOrDefault();
             if (result == null)
                 context.StationEquipmentsMaintenances.Add(newStationEquipmentsMaintenance);
             else
             {
                 result.MaintenanceDescription = newStationEquipmentsMaintenance.MaintenanceDescription;
                 result.MaintenanceCommants = newStationEquipmentsMaintenance.MaintenanceCommants;
                 result.powerSta = newStationEquipmentsMaintenance.powerSta;
                 result.communicationSta = newStationEquipmentsMaintenance.communicationSta;
                 result.samplingSta = newStationEquipmentsMaintenance.samplingSta;
                 result.senserSta = newStationEquipmentsMaintenance.senserSta;
                 result.cleaningSta = newStationEquipmentsMaintenance.cleaningSta;
                 result.stableSta = newStationEquipmentsMaintenance.stableSta;
                 result.MaintenanceDate = newStationEquipmentsMaintenance.MaintenanceDate;
                 result.ReportDate = newStationEquipmentsMaintenance.ReportDate;
                 result.Maintenner = newStationEquipmentsMaintenance.Maintenner;
                 result.Reportor = newStationEquipmentsMaintenance.Reportor;
             }
             context.SaveChanges();
             return Json("OK", JsonRequestBehavior.AllowGet);
         }
     }
     catch
     {
         return Json("NO", JsonRequestBehavior.AllowGet);
     }
 }
开发者ID:MadIHI,项目名称:InfoManage,代码行数:50,代码来源:EquipmentManagementController.cs

示例13: AjaxNetWorkRepairAdd

 public ActionResult AjaxNetWorkRepairAdd(string NetworkEquipmentCode, string NetWorkDeviceUsage, string NetworkEquipmentType, string NetworkEquipmentManufacturer, string FaultStartDate, string FaultEndDate, string PhenomenalDescription, string Resonance, string HandlingVResults, string Reportor, string ReportDate, bool UpRepair, string Repairer)
 {
     try
     {
         using (InfoManageDataContext context = new InfoManageDataContext())
         {
             NetWorkRepair newStationEquipmentsMaintenance = new NetWorkRepair();
             newStationEquipmentsMaintenance.NetworkEquipmentCode = NetworkEquipmentCode;
             newStationEquipmentsMaintenance.FaultStartDate = DateTime.ParseExact(FaultStartDate, AllConsts.HOUR_MINUTE, System.Globalization.DateTimeFormatInfo.CurrentInfo);
             newStationEquipmentsMaintenance.FaultEndDate = DateTime.ParseExact(FaultEndDate, AllConsts.HOUR_MINUTE, System.Globalization.DateTimeFormatInfo.CurrentInfo);
             newStationEquipmentsMaintenance.Resonance = Resonance;
             newStationEquipmentsMaintenance.PhenomenalDescription = PhenomenalDescription;
             newStationEquipmentsMaintenance.HandlingVResults = HandlingVResults;
             newStationEquipmentsMaintenance.Reportor = Reportor;
             newStationEquipmentsMaintenance.Repairer = Repairer;
             newStationEquipmentsMaintenance.ReportDate = DateTime.ParseExact(ReportDate, AllConsts.HOUR_MINUTE, System.Globalization.DateTimeFormatInfo.CurrentInfo);
             newStationEquipmentsMaintenance.UpRepair = UpRepair;
             NetWorkRepair result = context.NetWorkRepairs.Where(c => c.NetworkEquipmentCode.Equals(newStationEquipmentsMaintenance.NetworkEquipmentCode) && c.ReportDate.Equals(newStationEquipmentsMaintenance.ReportDate)).FirstOrDefault();
             if (result == null)
                 context.NetWorkRepairs.Add(newStationEquipmentsMaintenance);
             else
             {
                 result.Resonance = newStationEquipmentsMaintenance.Resonance;
                 result.PhenomenalDescription = newStationEquipmentsMaintenance.PhenomenalDescription;
                 result.HandlingVResults = newStationEquipmentsMaintenance.HandlingVResults;
                 result.FaultStartDate = newStationEquipmentsMaintenance.FaultStartDate;
                 result.FaultEndDate = newStationEquipmentsMaintenance.FaultEndDate;
                 result.Reportor = newStationEquipmentsMaintenance.Reportor;
                 result.Repairer = newStationEquipmentsMaintenance.Repairer;
                 result.UpRepair = newStationEquipmentsMaintenance.UpRepair;
             }
             context.SaveChanges();
             return Json("OK", JsonRequestBehavior.AllowGet);
         }
     }
     catch
     {
         return Json("NO", JsonRequestBehavior.AllowGet);
     }
 }
开发者ID:MadIHI,项目名称:InfoManage,代码行数:40,代码来源:EquipmentManagementController.cs

示例14: AjaxNetWorkMaintanceAdd

 public ActionResult AjaxNetWorkMaintanceAdd(string NetworkEquipmentCode, string Reportor, string ReportDate, string MaintenanceDescription, string Maintenner, string MaintenanceDate)
 {
     try
     {
         using (InfoManageDataContext context = new InfoManageDataContext())
         {
             NetWorkMaintance newStationEquipmentsMaintenance = new NetWorkMaintance();
             newStationEquipmentsMaintenance.NetworkEquipmentCode = NetworkEquipmentCode;
             newStationEquipmentsMaintenance.MaintenanceDescription = MaintenanceDescription;
             newStationEquipmentsMaintenance.Maintenner = Maintenner;
             newStationEquipmentsMaintenance.MaintenanceDate = DateTime.ParseExact(MaintenanceDate, AllConsts.HOUR_MINUTE, System.Globalization.DateTimeFormatInfo.CurrentInfo);
             newStationEquipmentsMaintenance.Reportor = Reportor;
             newStationEquipmentsMaintenance.ReportDate = DateTime.ParseExact(ReportDate, AllConsts.HOUR_MINUTE, System.Globalization.DateTimeFormatInfo.CurrentInfo);
             NetWorkMaintance result = context.NetWorkMaintances.Where(c => c.NetworkEquipmentCode.Equals(NetworkEquipmentCode) && c.MaintenanceDate.Equals(newStationEquipmentsMaintenance.MaintenanceDate)).FirstOrDefault();
             if (result == null)
                 context.NetWorkMaintances.Add(newStationEquipmentsMaintenance);
             else
             {
                 result.MaintenanceDescription = newStationEquipmentsMaintenance.MaintenanceDescription;
                 result.MaintenanceDate = newStationEquipmentsMaintenance.MaintenanceDate;
                 result.Maintenner = newStationEquipmentsMaintenance.Maintenner;
                 result.ReportDate = newStationEquipmentsMaintenance.ReportDate;
                 result.Reportor = newStationEquipmentsMaintenance.Reportor;
             }
             context.SaveChanges();
             return Json("OK", JsonRequestBehavior.AllowGet);
         }
     }
     catch
     {
         return Json("NO", JsonRequestBehavior.AllowGet);
     }
 }
开发者ID:MadIHI,项目名称:InfoManage,代码行数:33,代码来源:EquipmentManagementController.cs

示例15: Front

        public ActionResult Front()
        {
            try
            {
                if (Request.Cookies["User"] != null)
                {
                    HttpCookie aCookie = Request.Cookies["User"];
                    ViewBag.RealName = Server.UrlDecode(aCookie["RealName"]);
                    int id = Convert.ToInt32(Server.UrlDecode(aCookie["ID"]));
                    int UnitNum = Convert.ToInt32(Server.UrlDecode(aCookie["UnitNum"]));
                    ViewBag.UnitName = Server.UrlDecode(aCookie["UnitName"]);

                    using (MemberShipDataContext context = new MemberShipDataContext())
                    {
                        UserProfile usr = context.UserProfiles.Find(id);
                        if (null != usr)
                        {
                            using (InfoManageDataContext onlinecontext = new InfoManageDataContext())
                            {
                                UserAction newaction = new UserAction();
                                newaction.ID = usr.ID;
                                newaction.RealName = usr.RealName;
                                newaction.ActionName = "EquipmentManagement";
                                newaction.CreateTime = DateTime.Now;
                                newaction.LastModifyTime = newaction.CreateTime;
                                onlinecontext.UserActions.Add(newaction);
                                onlinecontext.SaveChanges();
                            }
                        }
                    }

                    ViewBag.Title = "维修维护管理";
                    ViewBag.UnitNum = UnitNum;
                    return View(UnitNum);
                }
                else
                {
                    WebSecurity.Logout();
                    return RedirectToAction("Login", "Admin");
                }
            }
            catch
            {
                WebSecurity.Logout();
                return RedirectToAction("Login", "Admin");
            }
        }
开发者ID:MadIHI,项目名称:InfoManage,代码行数:47,代码来源:EquipmentManagementController.cs


注:本文中的InfoManage.DataModels.InfoManageDataContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。