/// <summary> /// 下一张壁纸 /// </summary> private void NextWallpaper() { try { timerW.Stop(); LogHelper.WriteLog("更换壁纸", EnumLogLevel.Info); ImgInfo imgInfo = imgHelper.GetNextImage(); if (UserDataManage.IsDislike(imgInfo.Id)) { imgInfo = imgHelper.GetNextImage(); } string imgFullName = System.IO.Path.Combine(ConfigManage.Base.CachePath, imgInfo.GetFileName()); if (!File.Exists(imgFullName)) { // 判断下载目录中是否存在 imgFullName = System.IO.Path.Combine(ConfigManage.Base.DownPath, imgInfo.GetFileName()); if (!File.Exists(imgFullName)) { WebHelper.DownImage(imgInfo.url, imgFullName); } } if (File.Exists(imgFullName)) { Common.WinApi.SetWallpaper(imgFullName); UserDataManage.AddRecord(RecordType.AutoWallpaper, imgInfo); ConfigManage.Wallpaper.ReplaceLastTime = DateTime.Now; ConfigManage.Save(); } timerW.Start(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// 获取收款单:资金流(转账)。百秀兰溪》上海百秀旗舰店转账。 /// 功能点:ERP资金流=》转账 /// 业务点:上海百秀旗舰店天猫帮忙卖 百秀兰溪商品(财务手工做一次转账-ERP资金流转账) /// 数据库:lmShop_WasteBook /// </summary> /// <returns></returns> public IList <WasteBookDTO> GetGathering_WasteBook(DateTime StartTime, DateTime EndTime) { string LogisticsCompany = ConfigManage.GetConfigValue("BaiXiu_Lanxi_ID"); //物流公司 string SalesCompany = ConfigManage.GetConfigValue("BaiXiu_Shanghai_ID"); //销售公司 return(_gatheringDAL.GetGathering_WasteBook(StartTime, EndTime, LogisticsCompany, SalesCompany)); }
/// <summary> /// 判斷config 設定是否存在 並預設 /// </summary> private void CheckAppConfigSetting() { //如果沒有PointofixPath,建立config,key = PointofixPath ConfigManage.CreateConfig("PointofixPath"); //如果沒有ImageDecodePixel,建立config,key = ImageDecodePixel, value = 0 ConfigManage.CreateConfig("ImageDecodePixel", "0"); }
/// <summary> /// 签名验证 /// </summary> /// <param name="actionContext"></param> public override void OnActionExecuting(ActionExecutingContext actionContext) { try { base.OnActionExecuting(actionContext); //加密字符串参数 string ticket = actionContext.HttpContext.Request.Query["ticket"]; //业务类型 string bizType = actionContext.HttpContext.Request.Query["bizType"]; //业务ID string bizId = actionContext.HttpContext.Request.Query["bizId"]; if (!string.IsNullOrEmpty(ticket) && !string.IsNullOrEmpty(bizType) && !string.IsNullOrEmpty(bizId)) { string val = bizType + "#" + bizId + ConfigManage.AppSettings <string>("AppSettings:EncryptKey"); if (!ticket.ToUpper().Equals(StringHelper.ConvertTo32BitSHA1(val).ToUpper())) { //actionContext.Response = APIResponse.toJson(StateCode.State_9000); return; } } else { //actionContext.Response = APIResponse.toJson(StateCode.State_9001); return; } } catch (Exception ex) { ServiceIoc.Get <APILogsService>().Save("AppCheckUp==>" + ex.ToString()); } return; }
/// <summary> /// 根据银行账号Id获取结算公司名称和结算公司Id /// </summary> /// <param name="bankaccountId">银行账号Id</param> /// <returns></returns> /// zal 2015-11-11 public static string GetFilialeNameAndFilialeId(Guid bankaccountId) { string filialeName = "-", filialeId = Guid.Empty.ToString(); if (!bankaccountId.Equals(Guid.Empty)) { //主账号一定会绑定公司(即存在绑定表中),一个公司有多个主账号 var bankAccountBindList = BankAccountManager.ReadInstance.GetList(bankaccountId); var filialeInfoList = GetHeadList(); var joinQuery = (from bankAccountBind in bankAccountBindList join filialeInfo in filialeInfoList on bankAccountBind.TargetId equals filialeInfo.ID select new { filialeName = filialeInfo.Name, filialeId = filialeInfo.ID }).ToList(); if (joinQuery.Any()) { var firstOrDefault = joinQuery.First(); filialeName = firstOrDefault.filialeName; filialeId = firstOrDefault.filialeId.ToString(); } else { filialeName = "ERP公司"; filialeId = ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID"); } } return(filialeName + "," + filialeId); }
private void Button_Pointofix_Click(object sender, RoutedEventArgs e) { string PointofixPath = ConfigManage.ReadAppConfig("PointofixPath"); if (PathCheck.IsFileExist(PointofixPath)) { //如果Pointofix已經執行 先關閉 Process[] processes = Process.GetProcessesByName("Pointofix"); if (processes.Length > 0) { foreach (Process p in processes) { // 關閉目前程序前先等待 200 毫秒 p.WaitForExit(200); p.CloseMainWindow(); } } //啟用Pointofix Process pointofix = new Process(); pointofix.StartInfo.FileName = PointofixPath; pointofix.Start(); } else { MessageBox.Show("尚未找到Pointofix的執行程式,請至設定重新設定"); } }
/// <summary> /// 重置密码 /// </summary> /// <param name="user"></param> /// <returns></returns> public JsonResult ResetPsw(SysUser user) { string psw = ConfigManage.AppSettings <string>("AppSettings:DefaultPassWord"); StateCode state = ServiceIoc.Get <SysUserService>().ResetPsw(bid, psw); return(Json(GetResult(StateCode.State_200))); }
public BankAccountManager(IBankAccounts bankAccounts, IBankAccountDao bankAccountDao, IWasteBook wasteBook, Guid elseFilialeId) { _bankAccountDao = bankAccountDao; _bankAccounts = bankAccounts; _wasteBookDao = wasteBook; _reckoningElseFilialeid = elseFilialeId == Guid.Empty ? new Guid(ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID")) : elseFilialeId; }
public BankAccountManager(Environment.GlobalConfig.DB.FromType fromType) { _bankAccountDao = InventoryInstance.GetBankAccountDao(fromType); _bankAccounts = InventoryInstance.GetBankAccountsDao(fromType); _wasteBookDao = InventoryInstance.GetWasteBookDao(fromType); _reckoningElseFilialeid = new Guid(ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID")); }
private void LoadData() { var list = CacheCollection.Filiale.GetHeadList(); list.Add(new FilialeInfo { ID = new Guid(ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID")), Name = "ERP公司" }); RCB_Filliale.DataSource = list; RCB_Filliale.DataValueField = "ID"; RCB_Filliale.DataTextField = "Name"; RCB_Filliale.DataBind(); RCB_Filliale.Items.Insert(0, new RadComboBoxItem(string.Empty, Guid.Empty.ToString())); RCB_Branch.DataSource = CacheCollection.Branch.GetSystemBranchList().Where(act => act.ParentID == Guid.Empty).ToList(); RCB_Branch.DataValueField = "ID"; RCB_Branch.DataTextField = "Name"; RCB_Branch.DataBind(); RCB_Branch.Items.Insert(0, new RadComboBoxItem(string.Empty, Guid.Empty.ToString())); RCB_CompanyClass.DataValueField = "CompanyClassId"; RCB_CompanyClass.DataTextField = "CompanyClassName"; RCB_CompanyClass.DataSource = _costDao.GetCompanyClassList().ToList(); RCB_CompanyClass.DataBind(); RCB_CompanyClass.Items.Insert(0, new RadComboBoxItem(string.Empty, Guid.Empty.ToString())); RDP_StartTime.SelectedDate = DateTime.Now.Date.AddDays(-30); RDP_EndTime.SelectedDate = DateTime.Now; }
public AgencySettingTab2ViewModel() { //先建立config設定 CheckAppConfigSetting(); PointofixPath = ConfigManage.ReadAppConfig("PointofixPath"); ImageDecodePixel = ConfigManage.ReadAppConfig("ImageDecodePixel"); }
/// <summary> /// 获取付款单:资金流(转账)。上海百秀旗舰店》百秀兰溪转账。 /// 功能点:ERP资金流=》转账 /// 业务点:上海百秀旗舰店天猫向百秀兰溪转账 /// 数据库:lmShop_WasteBook /// </summary> /// <returns></returns> public IList <WasteBookDTO> GetPayment_WasteBook(DateTime StartTime, DateTime EndTime) { //转出公司(物流公司):上海百秀 444e0c93-1146-4386-bae2-cb352da70499 //转入公司(销售公司):百秀兰溪 75621b55-2fa3-4fcf-b68a-039c28f560b6 string LogisticsCompany = ConfigManage.GetConfigValue("BaiXiu_Shanghai_ID"); //物流公司 string SalesCompany = ConfigManage.GetConfigValue("BaiXiu_Lanxi_ID"); //销售公司 return(_paymentDAL.GetPayment_WasteBook(StartTime, EndTime, LogisticsCompany, SalesCompany)); }
/// <summary> /// 初始化数据 /// </summary> public void Initial() { //读取 enableRedis = ConfigManage.AppSettings <bool>("RedisConfig:EnableRedis"); if (enableRedis) { cacheRedis = CacheSessionFactory.Instance.CreateCache(); } //版本号 VNo = ConfigManage.AppSettings <string>("AppSettings:VNo"); //系统名称 SysName = ConfigManage.AppSettings <string>("AppSettings:SysName"); //资源域名 Res = ConfigManage.AppSettings <string>("AppSettings:DomainRes"); //后台域名 Admin = ConfigManage.AppSettings <string>("AppSettings:DomainAdmin"); //获取所有菜单 List <SysModelMenu> db_menus = ServiceIoc.Get <SysModelMenuService>().Where(m => m.is_enable == true).OrderByDescending(a => a.order_index).ToList(); //获取所有权限 List <SysPermission> db_permissions = ServiceIoc.Get <SysPermissionService>().GetAll().OrderByDescending(a => a.order_index).ToList(); //角色集合 List <SysRole> db_reles = ServiceIoc.Get <SysRoleService>().Where(r => r.is_enable == true).ToList(); //用户角色权限 List <UserRole> db_user_reles = ServiceIoc.Get <UserRoleService>().GetAll(); //所有用户权限 //List<SysUserPermission> db_user_permissions = ServiceIoc.Get<SysUserPermissionService>().GetAll(); //用户角色权限 List <SysRolePermission> db_role_permissions = ServiceIoc.Get <SysRolePermissionService>().GetAll(); //是否开启Redis缓存 if (EnableRedis) { //系统菜单 cacheRedis.Write(sys_menu_key, db_menus, CacheId.module); //系统权限 cacheRedis.Write(sys_func_key, db_permissions, CacheId.module); //系统角色 cacheRedis.Write(sys_role_key, db_reles, CacheId.module); //系统角色权限 cacheRedis.Write(sys_role_func_key, db_role_permissions, CacheId.module); } else { //系统菜单 menus = db_menus; //系统权限 permissions = db_permissions; //系统角色 roles = db_reles; //系统角色权限 rolePermissions = db_role_permissions; } }
public WeiXinLogin() { ThirdPartyPlatformSection cfg = ConfigManage.GetThePartyPlatform(); if (cfg != null) { this._appID = cfg.WXLogin.AppId; this._appSecret = cfg.WXLogin.AppSecret; this._callBackUrl = cfg.WXLogin.CallBackUrl; } }
private SMSBusiness() { _sendMessage = bool.Parse(ConfigManage.GetInstance().GetConfigByKey("SendMessage")); if (_sendMessage) { _client = new UdpClient(); string ipAddress = ConfigManage.GetInstance().GetConfigByKey("PlatformAddress"); int port = int.Parse(ConfigManage.GetInstance().GetConfigByKey("PlatformPort")); _remoteIpEndPoint = new IPEndPoint(IPAddress.Parse(ipAddress), port); MonitorAlarmBusiness.GetInstance().SendMessage += SMSBusiness_SendMessage; } }
public HttpServer() { //---------------- var pinganPayConfig = ConfigManage.GetPinganPayConfig(); var host = pinganPayConfig.DownSetting.ListenIP; var port = pinganPayConfig.DownSetting.ListenPort; //---------------- httpUrl = string.Format("http://{0}:{1}/", host, port); listener = new HttpListener(); listener.Prefixes.Add(httpUrl); }
/// <summary> /// 执行Action之前 /// </summary> /// <param name="context"></param> public async override void OnActionExecuting(ActionExecutingContext context) { //获取基类控制器 var baseController = ((BaseController)context.Controller); //获取请求参数 byte[] buffer = new byte[1024]; var len = await context.HttpContext.Request.Body.ReadAsync(buffer, 0, buffer.Length); List <byte> list = new List <byte>(); while (len > 0) { list.AddRange(buffer.Take(len)); //读取完成跳出循环 len = await context.HttpContext.Request.Body.ReadAsync(buffer, 0, buffer.Length); } //基类控制器 baseController.DynamicStr = Encoding.UTF8.GetString(list.ToArray()); //动态运行时对象 baseController.Dynamic = JsonConvert.DeserializeObject <dynamic>(baseController.DynamicStr); //post提交方式 if ("post".Equals(context.HttpContext.Request.Method.ToLower())) { if (context.HttpContext.User.Identity.IsAuthenticated) { string token = context.HttpContext.Request.Headers["Authorization"]; if (token.StartsWith("Bearer ", StringComparison.OrdinalIgnoreCase)) { token = token.Substring("Bearer ".Length).Trim(); } } //数据包 baseController.Sign = JsonConvert.DeserializeObject <SignPackage>(baseController.Dynamic.Global.ToString()); //签名校验 if (!WeiFosSign.SignAuth(sign_secret, baseController.DynamicStr)) { if (!ConfigManage.AppSettings <bool>("AppSettings:IsDebugModel")) { context.Result = APIResponse.GetResult(StateCode.State_5); } else { context.Result = APIResponse.GetResult(StateCode.State_5); } return; } } }
/// <summary> /// 根据公司id获取公司名称 /// </summary> /// <param name="filialeId"></param> /// <returns></returns> protected string GetFilialeName(string filialeId) { FilialeInfoList.Add(new FilialeInfo { ID = new Guid(ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID")), Name = "ERP公司" }); var firstOrDefault = FilialeInfoList.FirstOrDefault(p => p.ID.Equals(new Guid(filialeId))); if (firstOrDefault != null) { return(firstOrDefault.RealName); } return("-"); }
//结算公司 protected void LoadAssumeFilialeData() { var list = CacheCollection.Filiale.GetHeadList(); list.Add(new FilialeInfo { ID = new Guid(ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID")), Name = "ERP公司" }); ddl_AssumeFiliale.DataSource = list; ddl_AssumeFiliale.DataTextField = "Name"; ddl_AssumeFiliale.DataValueField = "ID"; ddl_AssumeFiliale.DataBind(); ddl_AssumeFiliale.Items.Insert(0, new ListItem("全部", "")); }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { try { this.Hide(); timerP.Stop(); timerP.Dispose(); timerP = null; timerL.Stop(); timerL.Dispose(); ConfigManage.Save(); } catch { } }
public async Task <IActionResult> UploadFile(List <IFormFile> files) { if (ConfigManage.AppSettings <bool>("WeChatSettings:IsOpenOss")) { //弱类型在这里不能初始化值,所以必须重新定义 var result = Uploader.UploadFile(HttpContext); return(Ok(result)); } else { var result = await Uploader.UploadFolderToAsync(HttpContext); return(Ok(result)); } }
//Grid数据源 protected void GridDataBind() { var erpFilialeId = ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID"); //未付款:待审核,已审核,未通过,已执行; 已付款:完成打款; //已审核过的单据(排除ERP公司的单据) var list = _companyFundReceipt.GetAllCompanyFundReceiptList().Where(p => (new int?[] { (int)CompanyFundReceiptState.NoAuditing, (int)CompanyFundReceiptState.Audited, (int)CompanyFundReceiptState.Executed, (int)CompanyFundReceiptState.Finish }).Contains(p.ReceiptStatus) && p.ReceiptType.Equals(1) && !p.FilialeId.ToString().Contains(erpFilialeId.ToLower())).OrderBy(p => p.ApplyDateTime).AsQueryable(); #region 查询条件 if (!string.IsNullOrEmpty(ddl_SaleFiliale.SelectedValue)) { list = list.Where(p => p.FilialeId.Equals(new Guid(ddl_SaleFiliale.SelectedValue))); } if (!string.IsNullOrEmpty(rcb_CompanyList.SelectedValue)) { list = list.Where(p => p.CompanyID.Equals(new Guid(rcb_CompanyList.SelectedValue))); } if (!string.IsNullOrEmpty(txt_ApplyDateTimeStart.Text)) { var startTime = DateTime.Parse(txt_ApplyDateTimeStart.Text); list = list.Where(p => p.ApplyDateTime >= startTime); } if (!string.IsNullOrEmpty(txt_ApplyDateTimeEnd.Text)) { var endtime = DateTime.Parse(txt_ApplyDateTimeEnd.Text); list = list.Where(p => p.ApplyDateTime < endtime.AddDays(1)); } if (!string.IsNullOrEmpty(txt_ReceipNo.Text)) { list = list.Where(p => p.ReceiptNo.Equals(txt_ReceipNo.Text)); } if (!string.IsNullOrEmpty(ddl_ReceiptStatus.SelectedValue)) { list = list.Where(p => p.ReceiptStatus.Equals(int.Parse(ddl_ReceiptStatus.SelectedValue))); } if (!string.IsNullOrEmpty(dll_InvoiceType.SelectedValue)) { list = list.Where(p => p.InvoiceType.Equals(int.Parse(dll_InvoiceType.SelectedValue))); if (!String.IsNullOrWhiteSpace(txtBillingUnit.Text)) { var invoiceId = _companyFundReceiptInvoice.GetAlllmshop_CompanyFundReceiptInvoice() .Where(ent => ent.BillingUnit.Contains(txtBillingUnit.Text)).Select(ent => ent.ReceiptID); list = list.Where(ent => invoiceId.Contains(ent.ReceiptID)); } } #endregion RG_ReceiptInvoice.DataSource = list.OrderByDescending(p => p.ApplyDateTime); }
private void ToggleButton_Save_Click(object sender, RoutedEventArgs e) { try { //診所設定判斷 Agencys agencys = agencySettingViewModel.Agencys; if (PathCheck.IsPathExist(agencys.Agency_ImagePath)) { new TableAgencys().UpdateAgency(agencys, agencys.Agency_ImagePath, agencys.Agency_WifiCardPath, agencys.Agency_ViewType, agencys.Function_ID); ReturnDialogResult = true; } else { if (MessageBox.Show("您所設定的影像路徑無法使用,可能會導致影像無法存取,是否繼續?", "提示", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) { new TableAgencys().UpdateAgency(agencys, agencys.Agency_ImagePath, agencys.Agency_WifiCardPath, agencys.Agency_ViewType, agencys.Function_ID); ReturnDialogResult = true; } } //其他 string PointofixPath = agencySettingViewModel.Pointofix; if (PathCheck.IsFileExist(PointofixPath) || string.IsNullOrEmpty(PointofixPath)) { ConfigManage.AddUpdateAppConfig("PointofixPath", PointofixPath); ReturnDialogResult = true; } else { if (MessageBox.Show("您所設定的Pointofix的位置不存在,可能會導致該軟體無法使用,是否繼續?", "提示", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) { ConfigManage.AddUpdateAppConfig("PointofixPath", PointofixPath); ReturnDialogResult = true; } } string ImageDecodePixel = agencySettingViewModel.ImageDecodePixel; ConfigManage.AddUpdateAppConfig("ImageDecodePixel", ImageDecodePixel); MessageBox.Show("設定已更改"); } catch (Exception ex) { MessageBox.Show("儲存設定時發生異常", "提示", MessageBoxButton.OK, MessageBoxImage.Error); ErrorLog.ErrorMessageOutput(ex.ToString()); } DialogResult = ReturnDialogResult; Close(); }
//遍历往来单位 private double RepetitionCompanyCussent(Guid companyClassId, IList <CompanyBalanceInfo> allCompanyBalanceList, IList <CompanyBalanceDetailInfo> allCompanyBalanceDetailList, RadTreeNode node) { double accountCount = 0; IList <CompanyCussentInfo> companyCussentList = AllCompanyList.Where(w => w.CompanyClassId == companyClassId).ToList(); foreach (CompanyCussentInfo companyCussentInfo in companyCussentList) { double leCount; if (FilialeId != Guid.Empty) { var companyBalanceDetailInfo = allCompanyBalanceDetailList.FirstOrDefault(w => w.CompanyId == companyCussentInfo.CompanyId && w.FilialeId == FilialeId); leCount = companyBalanceDetailInfo == null ? 0 : Convert.ToDouble(companyBalanceDetailInfo.NonceBalance); } else { var companyBalanceInfo = allCompanyBalanceList.FirstOrDefault(w => w.CompanyId == companyCussentInfo.CompanyId); leCount = companyBalanceInfo == null ? 0 : Convert.ToDouble(companyBalanceInfo.NonceBalance); } accountCount += leCount; RadTreeNode childNode = CreateNode(companyCussentInfo.CompanyName, false, companyCussentInfo.CompanyId.ToString()); childNode.ToolTip = "Company"; childNode.Text += "[" + leCount.ToString("N") + "]"; node.Nodes.Add(childNode); IList <FilialeInfo> list = FilialeList.Where(ent => ent.FilialeTypes.Contains((int)FilialeType.LogisticsCompany) || ent.FilialeTypes.Contains((int)FilialeType.SaleCompany)).ToList(); if (companyCussentInfo.RelevanceFilialeId != Guid.Empty) { list = list.Where(f => f.ID != companyCussentInfo.RelevanceFilialeId).ToList(); } list.Add(new FilialeInfo { ID = new Guid(ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID")), Name = "ERP" }); foreach (var filialeInfo in list) { var companyBalanceDetailInfo = allCompanyBalanceDetailList.FirstOrDefault(w => w.CompanyId == companyCussentInfo.CompanyId && w.FilialeId == filialeInfo.ID); double sum = companyBalanceDetailInfo == null ? 0 : Convert.ToDouble(companyBalanceDetailInfo.NonceBalance); var fnode = new RadTreeNode(filialeInfo.Name + "[" + sum.ToString("N") + "]", filialeInfo.ID.ToString()) { ToolTip = "Filiale" }; childNode.Nodes.Add(fnode); } } return(accountCount); }
/// <summary> /// 根据公司id获取公司名称 /// </summary> /// <param name="filialeId"></param> /// <returns></returns> protected string GetFilialeName(string filialeId) { var list = CacheCollection.Filiale.GetHeadList(); list.Add(new FilialeInfo { ID = new Guid(ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID")), Name = "ERP公司" }); var firstOrDefault = list.FirstOrDefault(p => p.ID.Equals(new Guid(filialeId))); if (firstOrDefault != null) { return(firstOrDefault.Name); } else { return("-"); } }
private void WriteParameterToiTac(ConfigManage configHandler) { GetApplicationDatas getData = new GetApplicationDatas(); List <ParameterEntity> entityList = getData.GetApplicationEntity(); string[] strs = GetParameterString(entityList); string[] strvalues = GetValueString(entityList); if (strs != null && strs.Length > 0) { int errorCode = configHandler.CreateConfigParameter(strs); if (errorCode == 0 || errorCode == 5) { CommonModel commonModel = ReadIhasFileData.getInstance(); int re = configHandler.UpdateParameterValues(commonModel.APPID, commonModel.APPTYPE, commonModel.Cluster, commonModel.Station, strvalues); } } //if (entityList.Count > 0) //{ // List<ParameterEntity> entitySubList = null; // CommonModel commonModel = ReadIhasFileData.getInstance(); // foreach (var entity in entityList) // { // entitySubList = new List<ParameterEntity>(); // entitySubList.Add(entity); // string[] strs = GetParameterString(entitySubList); // string[] strvalues = GetValueString(entitySubList); // if (strs != null && strs.Length > 0) // { // int errorCode = configHandler.CreateConfigParameter(strs); // if (errorCode == 0 || errorCode == 5) // { // int re = configHandler.UpdateParameterValues(commonModel.APPID, commonModel.APPTYPE, commonModel.Cluster, commonModel.Station, strvalues); // } // else if (errorCode == -3301)//Parameter already exists // { // int re = configHandler.UpdateParameterValues(commonModel.APPID, commonModel.APPTYPE, commonModel.Cluster, commonModel.Station, strvalues); // } // } // } //} }
static void CheckNet() { try { if (cacheManage == null) { cacheManage = new CacheManage(); } if (configManage == null) { configManage = new ConfigManage( m_ServerIp, //ConfigurationManager.AppSettings["REMOTEIP"].ToString(), int.Parse(ConfigurationManager.AppSettings["RemoteSKPORT"].ToString()), int.Parse(ConfigurationManager.AppSettings["RemoteRMPORT"].ToString())); //连接服务器套接字、REMOTING configManage.OnError += new ConfigManage.Error(_configManage_OnError); //错误处理 } } catch { Thread.Sleep(1); } }
/// <summary> /// 根据信息类型获取对应链接 /// </summary> /// <param name="content_type"></param> /// <param name="content_value"></param> /// <returns></returns> public static string GetLinkByType(WeChatAccountTmp account, int sid, int content_type, string usercode, string content_value) { StringBuilder sb = new StringBuilder(); switch (content_type) { //一键拨号 case MsgContentType.OneTouchDial: return(sb.Append("tel:").Append(content_value).ToString()); //外链 case MsgContentType.OutLink: return(content_value); //图文 case MsgContentType.ImgTextDetails: sb.Append(ConfigManage.AppSettings <string>("AppSettings:Res")); sb.Append("Home/InfoDetails/").Append(content_value).Append(".html"); return(sb.ToString()); //导航 case MsgContentType.Navigation: sb.Append("http://api.map.baidu.com/marker?location="); if (!string.IsNullOrEmpty(content_value) && content_value.IndexOf(",") != -1 && content_value.IndexOf("#") != -1) { int index = content_value.IndexOf("#"); string location = content_value.Substring(0, index); string address = content_value.Substring(index + 1, content_value.Length - index - 1); sb.Append(location); sb.Append("&title=").Append(account.nick_name); sb.Append("&content=").Append(address); sb.Append("&output=html"); } return(sb.ToString()); //微活动 case MsgContentType.WeiActivity: sb.Append(ConfigManage.AppSettings <string>("AppSettings:Mob")); sb.Append("weiactivity.aspx?"); sb.Append("aid=" + account.id + "&"); sb.Append("bid=" + content_value.Split('#')[0].ToString() + "&"); sb.Append("code=" + content_value.Split('#')[1].ToString() + "&"); sb.Append("usercode=" + usercode); return(sb.ToString()); //微相册 case MsgContentType.WeiAlbum: sb.Append(ConfigManage.AppSettings <string>("AppSettings:Mob")); sb.Append("Album/Album.aspx?"); sb.Append("bid=" + content_value); return(sb.ToString()); //微留言 case MsgContentType.WeiMessage: sb.Append(ConfigManage.AppSettings <string>("AppSettings:Mob")); sb.Append("weimessage.aspx?"); sb.Append("code=" + content_value + "&"); sb.Append("usercode=" + usercode); return(sb.ToString()); //名片 case MsgContentType.VisitingCard: sb.Append(ConfigManage.AppSettings <string>("AppSettings:Mob")); sb.Append("Home/MyQRCode"); return(sb.ToString()); //完成注册 case MsgContentType.Register: sb.Append(ConfigManage.AppSettings <string>("AppSettings:Mob")); sb.Append("Home/Register"); return(sb.ToString()); //微商城 case MsgContentType.WeiMall: sb.Append(ConfigManage.AppSettings <string>("AppSettings:Mob")); sb.Append("index"); return(sb.ToString()); //微预约 case MsgContentType.WeiResv: sb.Append(ConfigManage.AppSettings <string>("AppSettings:Mob")); sb.Append("WeiReservation/ResvOrderSubmit.aspx?"); sb.Append("aid=" + account.id + "&"); sb.Append("bid=" + content_value); return(sb.ToString()); //微信会员卡 case MsgContentType.MemberCard: sb.Append(ConfigManage.AppSettings <string>("AppSettings:Mob")); //存在会员卡号 if (content_value.IndexOf("#") != -1) { sb.Append("MemberCard/Index.aspx?"); sb.Append("aid=" + account.id + "&"); sb.Append("bid=" + content_value.Split('#')[0] + "&"); sb.Append(usercode); } //不存在会员卡号 else { sb.Append("MemberCard/ResvOrderSubmit.aspx?"); sb.Append("aid=" + account.id + "&"); sb.Append("bid=" + content_value); } return(sb.ToString()); default: return(""); } }
public ApplicationConfiguration(IMSApiSessionContextStruct sessionContext, MainView view) { try { dicConfig = new Dictionary <string, string>(); ConfigManage configHandler = new ConfigManage(sessionContext, view); CommonModel commonModel = ReadIhasFileData.getInstance(); if (commonModel.UpdateConfig == "L") { XDocument config = XDocument.Load("ApplicationConfig.xml"); StationNumber = commonModel.Station; Client = commonModel.Client; RegistrationType = commonModel.RegisterType; SerialPort = GetParameterValues(config, "SerialPort"); BaudRate = GetParameterValues(config, "BaudRate"); Parity = GetParameterValues(config, "Parity"); StopBits = GetParameterValues(config, "StopBits"); DataBits = GetParameterValues(config, "DataBits"); NewLineSymbol = GetParameterValues(config, "NewLineSymbol"); High = GetParameterValues(config, "High"); Low = GetParameterValues(config, "Low"); EndCommand = GetParameterValues(config, "EndCommand"); DLExtractPattern = GetParameterValues(config, "DLExtractPattern"); MBNExtractPattern = GetParameterValues(config, "MBNExtractPattern"); EquipmentExtractPattern = GetParameterValues(config, "EquipmentExtractPattern"); OpacityValue = GetParameterValues(config, "OpacityValue"); LocationXY = GetParameterValues(config, "LocationXY"); NoRead = GetParameterValues(config, "NoRead"); LogFileFolder = GetParameterValues(config, "LogFileFolder"); LogTransOK = GetParameterValues(config, "LogTransOK"); LogTransError = GetParameterValues(config, "LogTransError"); ChangeFileName = GetParameterValues(config, "ChangeFileName"); CheckListFolder = GetParameterValues(config, "CheckListFolder"); LoadExtractPattern = GetParameterValues(config, "LoadExtractPattern"); LogInType = GetParameterValues(config, "LogInType"); Language = GetParameterValues(config, "Language"); MDAPath = GetParameterValues(config, "MDAPath"); IPAddress = GetParameterValues(config, "IPAddress"); Port = GetParameterValues(config, "Port"); FileNamePattern = GetParameterValues(config, "FileNamePattern"); FilterByFileName = GetParameterValues(config, "FilterByFileName"); RefreshWO = GetParameterValues(config, "RefreshWO"); IPI_STATUS_CHECK = GetParameterValues(config, "IPI_STATUS_CHECK"); Production_Inspection_CHECK = GetParameterValues(config, "Production_Inspection_CHECK"); FILE_CLEANUP = GetParameterValues(config, "FILE_CLEANUP"); FILE_CLEANUP_TREAD_TIMER = GetParameterValues(config, "FILE_CLEANUP_TREAD_TIMER"); FILE_CLEANUP_FOLDER_TYPE = GetParameterValues(config, "FILE_CLEANUP_FOLDER_TYPE"); LIGHT_CHANNEL_ON = GetParameterValues(config, "LIGHT_CHANNEL_ON"); LIGHT_CHANNEL_OFF = GetParameterValues(config, "LIGHT_CHANNEL_OFF"); IO_BOX_CONNECT = GetParameterValues(config, "IO_BOX_CONNECT"); ReduceEquType = GetParameterValues(config, "ReduceEquType"); // config.Descendants("ReduceEquType").First().Value; StencilPrefix = GetParameterValues(config, "StencilPrefix"); //config.Descendants("StencilPrefix").First().Value; if (IO_BOX_CONNECT != null && IO_BOX_CONNECT.Split(';').Length >= 6) { string[] infos = IO_BOX_CONNECT.Split(';'); IOSerialPort = "COM" + infos[0]; IOBaudRate = infos[1]; IOStopBits = infos[4]; IODataBits = infos[2]; IOParity = infos[3]; } OutputEnter = GetParameterValues(config, "OutputEnter"); DataOutputInterface = GetParameterValues(config, "DataOutputInterface"); LAYER_DISPLAY = GetParameterValues(config, "LAYER_DISPLAY"); CHECKCONECTTIME = GetParameterValues(config, "CHECKCONECTTIME"); CEHCKTXTFILE = GetParameterValues(config, "CEHCKTXTFILE"); #region checklist CHECKLIST_IPAddress = GetParameterValues(config, "CHECKLIST_IPAddress"); CHECKLIST_Port = GetParameterValues(config, "CHECKLIST_Port"); CHECKLIST_SOURCE = GetParameterValues(config, "CHECKLIST_SOURCE"); AUTH_CHECKLIST_APP_TEAM = GetParameterValues(config, "AUTH_CHECKLIST_APP_TEAM"); CHECKLIST_FREQ = GetParameterValues(config, "CHECKLIST_FREQ"); SHIFT_CHANGE_TIME = GetParameterValues(config, "SHIFT_CHANGE_TIME"); RESTORE_TIME = GetParameterValues(config, "RESTORE_TIME"); RESTORE_TREAD_TIMER = GetParameterValues(config, "RESTORE_TREAD_TIMER"); AUTH_TEAM = GetParameterValues(config, "AUTH_TEAM"); #endregion } else { if (commonModel.UpdateConfig == "Y") { //int error = configHandler.DeleteConfigParameters(commonModel.APPTYPE); //if (error == 0 || error == -3303 || error == -3302) //{ // WriteParameterToiTac(configHandler); //} string[] parametersValue = configHandler.GetParametersForScope(commonModel.APPTYPE); if (parametersValue != null && parametersValue.Length > 0) { foreach (var parameterID in parametersValue) { configHandler.DeleteConfigParametersExt(parameterID); } } WriteParameterToiTac(configHandler); } List <ConfigEntity> getvalues = configHandler.GetConfigData(commonModel.APPID, commonModel.APPTYPE, commonModel.Cluster, commonModel.Station); if (getvalues != null) { foreach (var item in getvalues) { if (item != null) { string[] strs = item.PARAMETER_NAME.Split(new char[] { '.' }); dicConfig.Add(strs[strs.Length - 1], item.CONFIG_VALUE); } } } StationNumber = commonModel.Station; Client = commonModel.Client; RegistrationType = commonModel.RegisterType; SerialPort = GetParameterValue("SerialPort"); BaudRate = GetParameterValue("BaudRate"); Parity = GetParameterValue("Parity"); StopBits = GetParameterValue("StopBits"); DataBits = GetParameterValue("DataBits"); NewLineSymbol = GetParameterValue("NewLineSymbol"); High = GetParameterValue("High"); Low = GetParameterValue("Low"); EndCommand = GetParameterValue("EndCommand"); DLExtractPattern = GetParameterValue("DLExtractPattern"); MBNExtractPattern = GetParameterValue("MBNExtractPattern"); EquipmentExtractPattern = GetParameterValue("EquipmentExtractPattern"); OpacityValue = GetParameterValue("OpacityValue"); LocationXY = GetParameterValue("LocationXY"); ThawingDuration = GetParameterValue("ThawingDuration"); ThawingCheck = GetParameterValue("ThawingCheck"); LockTime = GetParameterValue("LockOutTime"); UsageTime = GetParameterValue("UsageDurationSetting"); GateKeeperTimer = GetParameterValue("GateKeeperTimer"); SolderPasteValidity = GetParameterValue("SolderPasteValidity"); OpenControlBox = GetParameterValue("OpenControlBox"); StencilPrefix = GetParameterValue("StencilPrefix"); TimerSpan = GetParameterValue("TimerSpan"); StartTrigerStr = GetParameterValue("StartTrigerStr"); EndTrigerStr = GetParameterValue("EndTrigerStr"); NoRead = GetParameterValue("NoRead"); } } catch (Exception ex) { LogHelper.Error(ex.Message, ex); } }
//配置验证 public string Manage() { ConfigManage _manage = new ConfigManage(); return(_manage.CheckServer()); }