protected override ScreenCanvas CreateScreenCanvas(Bll.ScreenDocument screen) { var canvas = new LayoutScreenCanvas(ToolProvider); canvas.Screen = screen; return canvas; }
public Cicada.Core.Ret<int> Add(Bll.Dtos.CustomerPostParam item) { if (item == null || string.IsNullOrWhiteSpace(item.Name)) return new Cicada.Core.Ret<int> { Status = 1 , Message = "用户名无效"}; if (string.IsNullOrWhiteSpace(item.Phone) ) return new Cicada.Core.Ret<int> { Status = 2, Message = "手机号无效" }; return new Cicada.Core.Ret<int>(); }
public Facede(Bll.Facede Application) { column = new Column(Application); corporationList = new CorporationList(Application); list = new List(Application); listColumn = new ListColumn(Application); listItem = new ListItem(Application); memberList = new MemberList(Application); }
public Facede(Bll.Facede Application) { corporationExpenses = new CorporationExpenses(Application); corporationRevenues = new CorporationRevenues(Application); expenseItem = new ExpenseItem(Application); expenses = new Expenses(Application); memberExpenses = new MemberExpenses(Application); memberRevenues = new MemberRevenues(Application); revenueItem = new RevenueItem(Application); revenues = new Revenues(Application); }
public static void ImportKKSFromFile <T>(FileInfo file) where T : IKKSCode, new() { Log.InfoStart("KKSCodeHelper.ImportKKSFromFile"); if (file.Exists == false) { Log.Info("不存在文件:" + file.FullName); } Bll bll = new Bll(); List <KKSCode> kksList = bll.KKSCodes.ToList(); if (kksList != null && kksList.Count == 0) { List <KKSCode> list = CreateKKSCodeListFromFile <KKSCode>(file); bll.KKSCodes.AddRange(bll.Db, list); //新增的部分 } Log.InfoEnd("KKSCodeHelper.ImportKKSFromFile"); }
public static void ImportRelationFromFile(FileInfo file) { Log.InfoStart(LogTags.DbInit, "LocationCardToPersonnelsBackupHelper.ImportRelationFromFile"); if (file.Exists == false) { Log.Info("不存在文件:" + file.FullName); } Bll bll = new Bll(); List <LocationCardToPersonnel> rList = bll.LocationCardToPersonnels.ToList(); if (rList != null) { List <Personnel> pList = bll.Personnels.ToList(); List <LocationCard> LcList = bll.LocationCards.ToList(); List <LocationCardToPersonnel> list = CreateRelationListFromFile(file, pList, LcList); bll.LocationCardToPersonnels.AddRange(bll.Db, list); //新增的部分 } Log.InfoEnd("LocationCardToPersonnelsBackupHelper.ImportRelationFromFile"); }
protected void btnAdd_Click(object sender, EventArgs e) { string sqlStr = @"INSERT INTO tb_News VALUES ('" + this.txtNewsTitle.Text.Trim() + "'," + "'" + this.txtNewsContent.Text.Trim() + "'," + "'" + this.labTitle.Text.Trim() + "'," + "'" + this.dlstNewsType.SelectedValue.ToString() + "'," + "'" + DateTime.Now.ToString("yyyy-MM-dd") + "')"; bool bl = Bll.ExecuteSQL(sqlStr); if (bl) { this.lblMessage.Text = "新闻添加成功!"; } else { this.lblMessage.Text = "新闻添加失败!"; } }
private void Form_Liaison_Externe_Load(object sender, EventArgs e) { try { //Chargement des employes du serveur string query = "SELECT CONCAT(id, ', ', CONCAT(nom, ' ', prenom)) AS Value FROM yvs_grh_employes WHERE agence = " + Constantes.AGENCE.Id + " ORDER BY nom, prenom"; employes = Bll.LoadListObject(query, Constantes.SOCIETE.AdresseIp); employes.Insert(0, "0,---"); //Chargement des employes du serveur query = "SELECT CONCAT(id, ', ', titre) AS Value FROM yvs_grh_tranche_horaire WHERE societe = " + Constantes.SOCIETE.Id + " ORDER BY type_journee, heure_debut"; tranches = Bll.LoadListObject(query, Constantes.SOCIETE.AdresseIp); tranches.Insert(0, "0,---"); } catch (Exception ex) { Messages.Exception(ex); } }
public static void ImportDevMonitorNodeFromFile <T>(FileInfo file) where T : DevMonitorNode, new() { Log.InfoStart("DevInfoHelper.ImportDevMonitorNodeFromFile"); if (file.Exists == false) { Log.Info("不存在文件:" + file.FullName); return; } Bll bll = new Bll(); List <DevMonitorNode> DevMonitorNodeList = bll.DevMonitorNodes.ToList(); if (DevMonitorNodeList != null && DevMonitorNodeList.Count == 0) { List <DevMonitorNode> list = CreateDevMonitorNodeListFromFile <DevMonitorNode>(file); bll.DevMonitorNodes.AddRange(bll.Db, list); //新增的部分 } Log.InfoEnd("DevInfoHelper.ImportDevMonitorNodeFromFile"); }
public static int ClearRepeatDev(Bll bll, string tag) { try { List <DevInfo> infoList = bll.DevInfos.ToList(); if (infoList == null || infoList.Count == 0) { return(0); } List <DevInfo> repeatDevs = GetRepeatDev(infoList, tag); bll.DevInfos.RemoveList(repeatDevs); return(repeatDevs.Count); }catch (Exception e) { string value = e.ToString(); Log.Error(e.ToString()); return(-1); } }
/// <summary> /// 通过文件导入设备信息 /// </summary> /// <param name="filePath"></param> /// <param name="devBll"></param> /// <returns></returns> public static bool ImportDevInfoFromFile(string filePath, Bll bll) { if (!File.Exists(filePath) || bll == null) { Log.Error("文件不存在:" + filePath); return(false); } var initInfo = XmlSerializeHelper.LoadFromFile <DevInfoBackupList>(filePath); if (initInfo == null || initInfo.DevList == null || initInfo.DevList.Count == 0) { return(false); } var areas = bll.Areas.ToList(); //var devs = bll.DevInfos.Where(i => i.Local_TypeCode != TypeCodes.Archor); //bll.DevInfos.RemoveList(devs);//先清空所有设备 foreach (var devInfo in initInfo.DevList) { if (devInfo.TypeCode == TypeCodes.Archor + "" || TypeCodeHelper.IsFireFightDevType(devInfo.TypeCode)) { continue; } if (devInfo.TypeCode == DeleteTypeCode) { //RemoveDeleteDev(devInfo, bll.DevInfos); } else { int?parentID = GetAreaIdByPath(devInfo.ParentName, areas); if (parentID != null) { devInfo.ParentId = (int)parentID; bool r = AddDevInfo(devInfo, bll.DevInfos); if (r == false) { Log.Info("ImportDevInfoFromFile Error:" + devInfo.Name); } } } } return(true); }
public async Task <ActionResult> Edit(string id) { var dbResult = await Bll.DB_Menu().FindByIdAsync(id); if (dbResult.resultItem != null) { var result = new MenuViewModel(); result.Name = dbResult.resultItem.Name; result.Controller = dbResult.resultItem.Controller; result.Action = dbResult.resultItem.Action; result.Icon = dbResult.resultItem.Icon; result.Rank = dbResult.resultItem.Rank; return(View(result)); } else { return(HttpNotFound()); } }
public ActionResult GetRegistros(GetRegistrosParams parametros) { try { logger.Info(new { parametros }); var registros = Bll.GetRegistrosDeIncidencias(parametros); var aaa = registros; logger.Error(new { registros }); //var xml = Extensiones.DeserializeFromXml<List<UtilsApp.Incidencias>>(doc); return(Json(new { data = registros }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { logger.Error(new { ex }); throw; } }
public ActionResult GetListadoEntregaRecompensas(string campania) { try { var listado = new List <ListadoEntregaRecompensas>(); //campania = "Enero - Junio 2019"; logger.Info(new { campania }); listado = Bll.GetListadoEntregaRecompensas(campania); logger.Info(new { listado }); return(PartialView("~/Views/Shared/ListadoRecompensas.cshtml", listado)); //return Json(new { data = listado }, JsonRequestBehavior.AllowGet); } catch (Exception ex) { logger.Error(new { ex }); throw; } }
public override bool TickFunction() { Log.Info(Name, "检查设备告警"); //清除某一个时间之前的所有告警 Bll db = Bll.NewBllNoRelation(); DateTime nowTime = DateTime.Now; DateTime starttime = DateTime.Now.AddDays(-DevAlarmKeepDays); var starttimeStamp = TimeConvert.ToStamp(starttime); var query = db.DevAlarms.DbSet.Where(i => i.AlarmTimeStamp < starttimeStamp); var count = query.Count(); if (count > 0) { query.DeleteFromQuery();//这样删除效率高 Log.Info(Name, "清除历史设备告警,数量:" + count); } db.Dispose(); return(true); }
private void ButtonLocationHistoryBack_Click(object sender, RoutedEventArgs e) { Bll bll = Bll.NewBllNoRelation(); if (!bll.DbHistory.Database.Exists()) { MessageBox.Show("数据库:LocationHistory 不存在,无法进行备份!"); return; } string tips = "数据库备份过程中,请勿关闭程序!\n点击确定开始备份,点击取消则退出备份"; if (MessageBox.Show(tips, "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK) { BackupByDBName(LocationHistoryMySql, LocationHistoryPathText); //备份locationhistory数据库 } else { MessageBox.Show("数据库备份已取消", "提示"); } }
public async Task<ActionResult> Index() { var result = new ResultItemList<ServerInfoViewModel>(); var dbModel = await Bll.DB_ServerInfo().ListAsync("10"); result.exceptionMessage = dbModel.exceptionMessage; foreach (var item in dbModel.resultItem) { result.data.Add(new ServerInfoViewModel { Id = item.Id, key_str = item.key_str, value_str = item.value_str }); } if (!String.IsNullOrEmpty(result.exceptionMessage)) { ModelState.AddModelError("", "Veriler Sistemden Getirilemedi"); } return View(result); }
public async Task<ActionResult> Delete(string id) { var dbModel = await Bll.DB_ServerInfo().FindByIdAsync(id); if (!String.IsNullOrEmpty(dbModel.exceptionMessage) || dbModel.resultItem == null) { return HttpNotFound(); } else { if (dbModel.resultItem != null) { var result = new ServerInfoViewModel(); result.Id = id; result.key_str = dbModel.resultItem.key_str; result.value_str = dbModel.resultItem.value_str; return View(result); } } return HttpNotFound(); }
/// <summary> /// 初始位置 /// </summary> public void Position() { //这里根据字符的长度来设置窗体的长度 this.Width = (Bll.GetStringLength(TipsLable.Content.ToString()) / 2) * 38; //屏幕宽高 double ScreenWidth = System.Windows.SystemParameters.PrimaryScreenWidth; double ScreenHeight = System.Windows.SystemParameters.PrimaryScreenHeight; this.Top = ScreenHeight - this.Height - 100; this.Left = (ScreenWidth / 2) - (this.Width / 2); this.Topmost = true; //时钟 timer = new DispatcherTimer(); //6秒后自动退出 timer.Interval = new TimeSpan(0, 0, 6); timer.Tick += timer1_Tick; timer.Start(); }
protected override void OnDispose() { if (UI != null) { UI.Dispose(); } if (Bll != null) { Bll.Dispose(); } if (Dal != null) { Dal.Dispose(); } UI = null; Bll = null; Dal = null; base.OnDispose(); }
public PodcastAppen() { try { InitializeComponent(); bll = new Bll(); LoadForm(); bll.getSparadPodcastLista(); bll.getSparadKategorierLista(); FillKategoriList(); bll.StartaTimer(); FillPodcastList(); startaUpdateAvGuiAsync(); } catch (Exception ex) { } }
private void MenuScan_Click(object sender, RoutedEventArgs e) { Bll bll = new Bll(); var list3 = bll.Archors.ToList(); var areas = bll.Areas.ToList(); foreach (var item in list3) { item.Parent = areas.Find(i => i.Id == item.ParentId); } var win = new ArchorConfigureWindow(list3); win.Show(); //udpArchorList = win.archorManager.archorList; //Group2.Header += " " + udpArchorList.Count; //DataGrid2.ItemsSource = udpArchorList; //Check(); }
public bool EditBusAnchor(Archor archor) { Bll db = new Bll(); bool bDeal = false; try { int nFlag = 0; var bac = db.bus_anchors.FirstOrDefault(p => p.anchor_id == archor.Code); if (bac == null) { bac = new DbModel.Engine.bus_anchor(); nFlag = 1; } bac.anchor_id = archor.Code; bac.anchor_x = (int)(archor.X * 100); bac.anchor_y = (int)(archor.Z * 100); bac.anchor_z = (int)(archor.Y * 100); bac.anchor_type = (int)archor.Type; bac.anchor_bno = 0; bac.syn_anchor_id = null; bac.offset = 0; bac.enabled = 1; if (nFlag == 0) { bDeal = db.bus_anchors.Edit(bac); } else { bDeal = db.bus_anchors.Add(bac); } } catch (Exception ex) { string strError = ex.Message; } return(bDeal); }
public async Task <ActionResult> Create(ProtectionCreateModel model) { if (ModelState.IsValid) { var request = await Bll.DB_Menu().AddPoint(new DataAccessLayer.AdoModel.RoleMenu { Id = Guid.NewGuid().ToString(), Menu_Id = model.menu_id, Role_Id = model.role_id }); if (request.success) { //this.ClearCache(); return(RedirectToAction("Index")); } } var roles = await Bll.DB_AspNetRoles().ListAsync(); var menus = await Bll.DB_Menu().ListMainMenuAsync(); var result = new ProtectionViewModel(); foreach (var item in roles.resultItem) { result.roles.Add(new RoleViewModel { Id = item.Id, Name = item.Name }); } foreach (var item in menus.resultItem) { result.menu.Add(new MenuViewModel { Id = item.Id, Name = item.Name }); } return(View(result)); }
public static void InitDbAsync(int mode, Action <Bll> callBack, bool isForce = false) { Log.InfoStart("InitDb"); Bll bll; if (isForce && DbSource == 1) { string dir = AppDomain.CurrentDomain.BaseDirectory; string file1 = dir + "location.db"; if (File.Exists(file1)) { File.Delete(file1); } string file2 = dir + "locationHis.db"; if (File.Exists(file2)) { File.Delete(file2); } bll = new Bll(); } else { bll = new Bll(); //if (isForce) //{ // //bll.Db.Database.Delete(); // //bll.Db.Database.Create(); // bll.DbHistory.Database.Delete(); // bll.DbHistory.Database.Create(); //} } bll.InitAsync(mode, (b) => { Log.InfoEnd("InitDb"); if (callBack != null) { callBack(b); } }); }
/// <summary> /// 时钟事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void timer1_Tick(object sender, EventArgs e) { Count--; if (Count <= 0) { //只有检测到键盘或者鼠标有动静时才会彻底解锁 if (Bll.GetLastInputTime() < 1000) { this.Close(); } else { PromptText.Text = "移动鼠标将会自动解锁"; Unlock.Visible = true; } } else { PromptText.Text = "距离解锁时间还有" + Count + "秒"; } }
public async Task <JsonResult> Filter(string args) { var user = await UserManager.FindByEmailAsync(User.Identity.Name); var request = await Bll.Db_Notes().ListAsync(user.Id, args); var result = new List <NotesViewModel>(); foreach (var item in request.resultItem) { result.Add(new NotesViewModel { Id = item.Id, Title = item.Title, User_Id = item.User_Id, Description = item.Description, CreatedDateView = item.CreatedDate.Value.ToShortDateString() }); } return(Json(result, JsonRequestBehavior.AllowGet)); }
public void BackupPersonInfo(Action callBack = null) { Thread thread = new Thread(() => { Bll bll = new Bll(); List <Personnel> Perlst = bll.Personnels.ToList(); Log.Info("Init PersonIs..."); DateTime recordT = DateTime.Now; //1.备份人员信息 SaveBackupPersonInfo(Perlst); Log.Info(string.Format("Init PersonIs complete,cost time: {0}s.", (DateTime.Now - recordT).TotalSeconds.ToString("f4"))); if (callBack != null) { callBack(); } }); thread.IsBackground = true; thread.Start(); }
public void BackupDepartmentsInfo(Action callBack = null) { Thread thread = new Thread(() => { Bll bll = new Bll(); List <Department> Deplst = bll.Departments.ToList(); Log.Info("Init Departments..."); DateTime recordT = DateTime.Now; //1.备份普通设备 SaveBackupDepartmentsInfo(Deplst); Log.Info(string.Format("Init Departments complete,cost time: {0}s.", (DateTime.Now - recordT).TotalSeconds.ToString("f3"))); if (callBack != null) { callBack(); } }); thread.IsBackground = true; thread.Start(); }
public async Task <ActionResult> Create(ProjectViewModel model) { if (ModelState.IsValid) { var user = await UserManager.FindByEmailAsync(User.Identity.Name); var result = await Bll.DB_Projects().Add(new DataAccessLayer.AdoModel.Projects { Id = Guid.NewGuid().ToString(), Name = model.Name, User_Id = user.Id }); if (result.success) { return(RedirectToAction("Index", "Project")); } } ModelState.AddModelError("", "Proje Oluşturulamadı!"); return(View(model)); }
/// <summary> /// 通过文件导入门禁卡信息 /// </summary> /// <param name="filePath"></param> /// <param name="devBll"></param> /// <returns></returns> public static bool ImportEntranceGuardCardInfoFromFile(string filePath, Bll bll) { if (!File.Exists(filePath) || bll == null) { Log.Error("文件不存在:" + filePath); return(false); } var initInfo = XmlSerializeHelper.LoadFromFile <EntranceGuardCardInfoBackupList>(filePath); if (initInfo == null || initInfo.EcList == null || initInfo.EcList.Count == 0) { return(false); } var areas = bll.Areas.ToList(); foreach (var ec in initInfo.EcList) { AddEntranceGuardCardInfo(ec, bll); } return(true); }
/// <summary> /// 通过文件导入部门信息 /// </summary> /// <param name="filePath"></param> /// <param name="devBll"></param> /// <returns></returns> public static bool ImportDepartmentInfoFromFile(string filePath, Bll bll) { if (!File.Exists(filePath) || bll == null) { Log.Error("文件不存在:" + filePath); return(false); } var initInfo = XmlSerializeHelper.LoadFromFile <DepartmentInfoBackupList>(filePath); if (initInfo == null || initInfo.DepList == null || initInfo.DepList.Count == 0) { return(false); } var areas = bll.Areas.ToList(); foreach (var Dep in initInfo.DepList) { AddDepartmentInfo(Dep, bll); } return(true); }
public void BackupEntranceGuardCardInfo(Action callBack = null) { Thread thread = new Thread(() => { Bll bll = new Bll(); List <EntranceGuardCard> Eclst = bll.EntranceGuardCards.ToList(); Log.Info("Init EntranceGuardCards..."); DateTime recordT = DateTime.Now; //1.备份门禁卡信息 SaveBackupEntranceGuardCardInfo(Eclst); Log.Info(string.Format("Init EntranceGuardCards complete,cost time: {0}s.", (DateTime.Now - recordT).TotalSeconds.ToString("f5"))); if (callBack != null) { callBack(); } }); thread.IsBackground = true; thread.Start(); }
/// <summary> /// 获取静态设备相关的测点数据 /// </summary> public static void GetAllStaticDevsMonitorData() { WebApiHelper.IsSaveJsonToFile = true; Bll bll = Bll.Instance(); LocationService service = new LocationService(); var staticDevs = bll.DevInfos.Where(i => i.Local_TypeCode == 20181008); //镜头设备 DateTime start = DateTime.Now; for (int i = 0; i < staticDevs.Count; i++) { DevInfo dev = staticDevs[i]; Log.Info(LogTags.KKS, string.Format("获取数据:{0}[{1}],({2}/{3})", dev.Name, dev.KKS, i, staticDevs.Count)); var monitor = service.GetDevMonitorInfoByKKS(dev.KKS, true); //获取数据,这里需要优化 } TimeSpan time = DateTime.Now - start; Log.Info(LogTags.KKS, string.Format("完成 用时:{0}", time)); WebApiHelper.IsSaveJsonToFile = false; }
public Facede(Bll.Facede Application) { }
public Facede(Bll.Facede Application) { account = new Account(Application); }
public Facede(Bll.Facede Application) { category = new Category(Application); label = new Label(Application); }