public void GetByKey_Anykey_CallsQueryMethodOfRepository() { // Setup dependency var settingsMock = new Mock<ISettings>(); var uoMock = new Mock<IUnitOfWork>(); var repositoryMock = new Mock<IRepository>(); var serviceLocatorMock = new Mock<IServiceLocator>(); serviceLocatorMock.Setup(x => x.GetInstance<IRepository>()) .Returns(repositoryMock.Object); ServiceLocator.SetLocatorProvider(() => serviceLocatorMock.Object); // Arrange Guid id = Guid.NewGuid(); var key = "MARK_UP_ON_PLATFORM"; SystemConfig system = new SystemConfig() { Id=id, Name = key, Value = "1234" }; SystemConfig[] systems = new SystemConfig[] { system }; repositoryMock.Setup(e => e.Query<SystemConfig>()).Returns(systems.AsQueryable()); // Act var systemConfigService = new SystemConfigService(uoMock.Object, repositoryMock.Object, settingsMock.Object); SystemConfigDto actualSystemconfig = systemConfigService.GetByKey(key); // Assert Assert.AreEqual(id, actualSystemconfig.Id); }
public void GetGST_GSTRATE_GetByKey() { // Setup dependency var settingsMock = new Mock<ISettings>(); var repositoryMock = new Mock<IRepository>(); var uoMock = new Mock<IUnitOfWork>(); var serviceLocatorMock = new Mock<IServiceLocator>(); serviceLocatorMock.Setup(x => x.GetInstance<IRepository>()) .Returns(repositoryMock.Object); ServiceLocator.SetLocatorProvider(() => serviceLocatorMock.Object); // Arrange Guid id = Guid.NewGuid(); SystemConfig sys = new SystemConfig() { Name = "GST_RATE", Value ="1234" }; SystemConfig [] systems = new SystemConfig[] {sys}; repositoryMock.Setup(e => e.Query<SystemConfig>()).Returns(systems.AsQueryable()); // Act var systemConfigService = new SystemConfigService(uoMock.Object, repositoryMock.Object, settingsMock.Object); decimal actulvalue = systemConfigService.GetGST(); // Assert Assert.AreEqual(decimal.Parse(sys.Value, CultureInfo.InvariantCulture), actulvalue); }
public bool Equals(SystemConfig config) { if (config == null) { return false; } return object.ReferenceEquals(this, config) || object.Equals(this.Env, config.Env) && this.Resources.SequenceEqual(config.Resources) && object.Equals(this.Env2, config.Env2); }
public UnparsedQueueManager(SystemConfig config) { Uri connecturi = new Uri(config.ACTIVEMQ_URI); IConnectionFactory factory = NMSConnectionFactory.CreateConnectionFactory(connecturi); connection = factory.CreateConnection(); session = connection.CreateSession(); connection.Start(); IDestination destination = SessionUtil.GetDestination(session, config.UNPARSED_QUEUE); producer = session.CreateProducer(destination); }
public bool AddConfig(SystemConfig objConfig) { try { repSystemConfig.Add(objConfig); SaveChanges(); return true; } catch { return false; } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, System.EventArgs e) { UAC uac = this.HisEn.HisUAC; if (uac.IsView == false) { throw new Exception("您没有查看[" + this.HisEn.EnDesc + "]数据的权限."); } if (this.IsPostBack == false) { BP.Sys.Contrast c = new BP.Sys.Contrast(); c.MyPK = this.EnsName + WebUser.No; if (c.RetrieveFromDBSources() == 0) { c.ContrastKey = this.Request.QueryString["ContrastKey"]; } try { #region 设置tool bar 1 的contral #region 判断权限 if (uac.IsView == false) { throw new Exception("@对不起,您没有查看的权限!"); } #endregion // 比较对象。 Map map = this.HisEn.EnMap; string NoShowCont = "@FK_Dot@FK_Rate@"; // string NoShowCont = SystemConfig.GetConfigXmlEns("NoShowContrast", this.EnsName); foreach (Attr attr in map.Attrs) { if (attr.MyFieldType == FieldType.FK || attr.MyFieldType == FieldType.PKFK) { if (NoShowCont.Contains(attr.Key)) { continue; } this.DDL_ContrastKey.Items.Add(new ListItem(attr.Desc, attr.Key)); } } this.DDL_ContrastKey.SetSelectItem(c.ContrastKey); foreach (Attr attr in map.Attrs) { if (attr.IsPK) { continue; } if (attr.UIContralType == UIContralType.TB == false) { continue; } if (attr.MyFieldType == FieldType.FK) { continue; } if (attr.MyFieldType == FieldType.Enum) { continue; } if (attr.MyFieldType == FieldType.PKEnum) { continue; } if (attr.Key == "OID" || attr.Key == "WorkID" || attr.Key == "MID") { continue; } switch (attr.MyDataType) { case DataType.AppDouble: case DataType.AppFloat: case DataType.AppInt: case DataType.AppMoney: case DataType.AppRate: this.DDL_GroupField.Items.Add(new ListItem(attr.Desc, attr.Key)); break; default: break; } } this.DDL_GroupField.SetSelectItem(this.ContrastObj); this.DDL_GroupWay.Items.Add(new ListItem("求和", "0")); this.DDL_GroupWay.Items.Add(new ListItem("求平均", "1")); this.DDL_OrderWay.Items.Add(new ListItem("降序", "0")); this.DDL_OrderWay.Items.Add(new ListItem("升序", "1")); if (this.Request.QueryString["OperateCol"] != null) { string[] strs = this.Request.QueryString["OperateCol"].Split('_'); this.DDL_GroupField.SetSelectItem(strs[0]); this.DDL_GroupWay.SetSelectItem(strs[1]); } #endregion this.ToolBar1.InitByMapV2(this.HisEn.EnMap, 1); this.BindContrastKey(map); InitState(c); this.SetDGData(); } catch (Exception ex) { this.HisEns.DoDBCheck(DBCheckLevel.High); throw new Exception("@装载出现错误:" + ex.Message); } } //this.ToolBar1.ButtonClick += new System.EventHandler(this.ToolBar1_ButtonClick); string lab = SystemConfig.GetConfigXmlEns("Contrast", this.EnsName); if (lab == null) { lab = this.HisEn.EnMap.EnDesc; } this.Label2.Text = this.ContrastLab + "1"; this.Label3.Text = this.ContrastLab + "2"; this.Label1.Text = this.GenerCaption(lab); // this.Label1.Controls.Add(this.GenerLabel("<img src='../Img/Btn/DataGroup.gif' border=0 />" + lab)); this.DDL_ContrastKey.AutoPostBack = true; this.DDL_ContrastKey.SelectedIndexChanged += new EventHandler(DDL_ContrastKey_SelectedIndexChanged); this.BindDDLMore(); }
//파일관련 업로드 private bool UploadFiles() { if (btnBusinessPic.PostedFile.ContentLength > 0 && cbKeepBP.Checked == false) { //먼저 이미지 파일인가를 확인한다. if (!FileLib.Self.IsImageFileExts(btnBusinessPic)) { return(false); } //관련이미지 이동(이미 검증되었기 때문에 파일세이브) FileLib.Self.FileNamesMoveTo(SystemConfig.GetValue("StaffUploadDir"), "MyPic_" + _sfID, SystemConfig.GetValue("UploadDirBackup") + "stfData.bak/"); //저장 //FileLib.Self.ImageFileSave(btnBusinessPic, SystemConfig.GetValue("StaffUploadDir"), FileLib.Self.GetFileNameWithoutExtension(sf.sBusinessPic)); FileLib.Self.FileSave(btnBusinessPic, SystemConfig.GetValue("StaffUploadDir"), FileLib.Self.GetFileNameWithoutExtension(_ssb.sBusinessPic)); } if (btnAvataImage.Value != "" && cbKeepAI.Checked == false) { //관련이미지 이동 FileLib.Self.FileNamesMoveTo(SystemConfig.GetValue("StaffUploadDir"), "Avata_" + _sfID, SystemConfig.GetValue("UploadDirBackup") + "stfData.bak/"); //저장 HTML.ReplaceToDB(btnAvataImage.Value); } if (btnData.Value != "" && cbKeepData.Checked == false) { //관련데이타 이동 FileLib.Self.FileNamesMoveTo(SystemConfig.GetValue("StaffDataUploadDir"), "sData_" + _sfID + "*", SystemConfig.GetValue("UploadDirBackup") + "stfData.bak/fileData.bak/"); //저장 //sf.sData = FileLib.Self.FileSave(HTML.ReplaceToDB(btnData.Value), SystemConfig.GetValue("StaffUploadDir")+"fileData/", "sData_" + sfID + "_" + System.DateTime.Today.ToShortDateString()); FileLib.Self.FileSave(btnData, SystemConfig.GetValue("StaffUploadDir") + "fileData/", FileLib.Self.GetFileNameWithoutExtension(_ssb.sData)); //Response.End(); } return(true); }
protected void ibInsert_Click(object sender, ImageClickEventArgs e) { ibInsert.Enabled = false; //아디디 중복되나 최종확인 if (StfBaseLib.Self.sLoginID_Exist(sLoginID.Text)) { ClientAction.ShowMsgBack("입력하신 아이디는 존재합니다. 중복확인을 하세요."); } //데이타 충전 _ssb = new MiddleTier.Staff.StfStaffBiz(); _ssb.staff_id = StfBaseLib.Self.GetNextStaff_id(); //공통부분/////////// CommonInsertUpdate(); ///////////////////// if (btnBusinessPic.Value != "") { _ssb.sBusinessPic = "MyPic_" + _ssb.staff_id.ToString() + FileLib.Self.GetExtention(btnBusinessPic.Value); } else { _ssb.sBusinessPic = ""; } if (btnAvataImage.Value != "") { _ssb.sAvataImage = "Avata_" + _ssb.staff_id.ToString() + FileLib.Self.GetExtention(btnAvataImage.Value); } else { _ssb.sAvataImage = ""; } if (btnData.Value != "") { _ssb.sData = "sData_" + _ssb.staff_id.ToString() + "_" + System.DateTime.Today.ToShortDateString() + FileLib.Self.GetExtention(btnData.Value); } else { _ssb.sData = ""; } _ssb.sLoginID = HTML.ReplaceToDB(sLoginID.Text); //DB업데이트 int sp_result = _ssb.Insert(); //파일업로드 _sfID = sp_result.ToString(); bool up_result = this.UploadFiles(); if (sp_result > 0) { //직원수를 업데이트한다. PtnBaseLib.Self.UpdateAllPtnStaffNumber(_ssb.position); if (up_result == false) { ClientAction.ShowMsgAndGoUrl("이미지파일이 아닙니다!! 다시 수정업로드하세요. \\n[가능한 확장자 : " + ImageLib.Self.imagesExtsForWeb + "]", "PtnList.aspx?" + URLQuery.Self.GetQueryString()); } //메일보관디렉토리생성 DirectoryLib.Self.Create(SystemConfig.GetValue("MailUploadDir") + "ma_" + _ssb.staff_id + "_" + sLoginID.Text); ClientAction.ShowMsgAndGoUrl("정상적으로 입력되었습니다.", " PtnList.aspx?" + URLQuery.Self.GetQueryString()); } else { ClientAction.ShowMsgAndGoUrl("입력작업이 실패했습니다." + "Code:" + sp_result, "PtnList.aspx?" + URLQuery.Self.GetQueryString()); } }
/// <summary> /// 发送邮件 /// </summary> /// <param name="mail"></param> /// <param name="mailTitle"></param> /// <param name="mailDoc"></param> /// <returns></returns> public static bool SendEmailNow(string mail, string mailTitle, string mailDoc) { System.Net.Mail.MailMessage myEmail = new System.Net.Mail.MailMessage(); //邮件地址. string emailAddr = SystemConfig.GetValByKey("SendEmailAddress", null); if (emailAddr == null) { emailAddr = "*****@*****.**"; } string emailPassword = SystemConfig.GetValByKey("SendEmailPass", null); if (emailPassword == null) { emailPassword = "******"; } myEmail.From = new System.Net.Mail.MailAddress(emailAddr, emailPassword, System.Text.Encoding.UTF8); myEmail.To.Add(mail); myEmail.Subject = mailTitle; myEmail.SubjectEncoding = System.Text.Encoding.UTF8;//邮件标题编码 myEmail.Body = mailDoc; myEmail.BodyEncoding = System.Text.Encoding.UTF8; //邮件内容编码 myEmail.IsBodyHtml = true; //是否是HTML邮件 myEmail.Priority = MailPriority.High; //邮件优先级 SmtpClient client = new SmtpClient(); //是否启用ssl? bool isEnableSSL = false; string emailEnableSSL = SystemConfig.GetValByKey("SendEmailEnableSsl", null); if (emailEnableSSL == null || emailEnableSSL == "0") { isEnableSSL = false; } else { isEnableSSL = true; } client.Credentials = new System.Net.NetworkCredential(emailAddr, emailPassword); //上述写你的邮箱和密码 client.Port = SystemConfig.GetValByKeyInt("SendEmailPort", 587); //使用的端口 client.Host = SystemConfig.GetValByKey("SendEmailHost", "smtp.gmail.com"); // 经过ssl加密. if (SystemConfig.GetValByKeyInt("SendEmailEnableSsl", 1) == 1) { client.EnableSsl = true; //经过ssl加密. } else { client.EnableSsl = false; //经过ssl加密. } try { object userState = myEmail; client.SendAsync(myEmail, userState); return(true); } catch { return(false); } }
public Factory(IRootFolder rootFolder, SystemConfig systemConfig) { this.rootFolder = rootFolder; this.config = systemConfig; }
private string message2(string subject, string message) { string strMsgContent = string.Empty; try { strMsgContent = "<div style=\"border:solid 1px #efefef;\"><div style=\"width:800;border:solid " + "1px #efefef;font-weight:bold; font-family:Verdana;font-size:12px; text-align:left;" + " background-color:#efefef;\" > <strong>Dear</strong> <span >" + " " + Name.Text.Trim() + ", " + "</span></div>" + "<br />"; strMsgContent = strMsgContent + "You have a message from : " + Name.Text.Trim() + ", <br/><br/>"; strMsgContent = strMsgContent + "email: " + Email.Text.Trim() + " <br/><br/>"; strMsgContent = strMsgContent + "Subject: " + subject + " <br/><br/>"; strMsgContent = strMsgContent + "Message: " + message + " <br/><br/>"; strMsgContent = strMsgContent + "<br /> <strong>This is an automated response to activate your account. Please do not reply to this email.<br /><br />"; strMsgContent = strMsgContent + "Sincerely yours,<br /> <a href=\"" + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + "\">" + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + "</a></strong><br /><br /></div>"; strMsgContent = strMsgContent + "</br><span style=\"color:#818181; font-style:italic; font-size:12px;\">This email is confidential and is intended only for the individual named. Although reasonable precautions have been taken to ensure no viruses are present in this email," + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + " do not warrant that this e-mail is free from viruses or other corruptions and is not liable to the recipient or any other party should any virus or other corruption be present in this e-mail. If you have received this email in error please notify the sender.</span>"; } catch (Exception ex) { strMsgContent = string.Empty; } return(strMsgContent); }
public bool UpdateConfig(SystemConfig objConfig) { try { repSystemConfig.Update(objConfig); SaveChanges(); return true; } catch { return false; ; } }
/// <summary> /// 注册NLog服务 /// </summary> /// <param name="services"></param> /// <param name="config"></param> public static IServiceCollection RegisterNLog(this IServiceCollection services, SystemConfig config) { services.AddNLogger(s => { s.TargetGeneratorOptions .Add(new TargetGeneratorOptions { MinLevel = NLog.LogLevel.FromOrdinal(config.MinLogLevel), Target = config.LoggerType switch { LoggerType.File => new FileTarget { Name = config.LoggerName, Layout = config.LoggerLayout ?? LoggerConfig.Layout, FileName = Path.Combine(Directory.GetCurrentDirectory(), LoggerConfig.FileDic, LoggerConfig.FileName), Encoding = Encoding.UTF8 }, _ => new ColoredConsoleTarget { Name = config.LoggerName, Layout = config.LoggerLayout ?? LoggerConfig.Layout }, } }); })
/// <summary> /// Parse the incoming packet for all the Data Sets. /// Add the data to a AdcpDataSet variable and /// return the filled variable when complete. /// </summary> /// <param name="binaryEnsemble">Byte array containing data from an ADCP.</param> /// <returns>Object holding decoded ADCP data.</returns> private Ensemble DecodeAdcpData(byte[] binaryEnsemble) { Ensemble ensemble = new Ensemble(); #region DataSets if(!ensemble.IsEnsembleAvail) { ensemble.EnsembleData = new EnsembleDataSet(); ensemble.IsEnsembleAvail = true; } if (!ensemble.IsAncillaryAvail) { ensemble.AncillaryData = new AncillaryDataSet(); ensemble.IsAncillaryAvail = true; } // Add Bottom Track data if (!ensemble.IsBottomTrackAvail) { ensemble.BottomTrackData = new BottomTrackDataSet(); ensemble.IsBottomTrackAvail = true; } // Add DVL dataset if (!ensemble.IsDvlDataAvail) { ensemble.DvlData = new DvlDataSet(); ensemble.IsDvlDataAvail = true; } #endregion #region System Config // Data Flow Bit byte data = binaryEnsemble[1]; SystemConfig sysCfg = new SystemConfig(); //sysCfg.VelTransform = GetTransform(value); //sysCfg.IsTiltUsed = GetTilt(value); //sysCfg.Is3BeamSolution = Get3BeamSolution(value); //sysCfg.Frequency = GetFreq(value); // Set the serial number ensemble.EnsembleData.SysSerialNumber = SerialNumber.DVL; ensemble.EnsembleData.SysSerialNumber.RemoveSubsystem(SerialNumber.DVL_Subsystem); ensemble.EnsembleData.SysSerialNumber.AddSubsystem(sysCfg.Frequency); #endregion //#region Speed of Sound //// Speed of Sound ////ensemble.AncillaryData.SpeedOfSound = MathHelper.LsbMsbUShort(binaryEnsemble[41], binaryEnsemble[42]); ////ensemble.BottomTrackData.SpeedOfSound = MathHelper.LsbMsbUShort(binaryEnsemble[41], binaryEnsemble[42]); ////ensemble.DvlData.SpeedOfSound = MathHelper.LsbMsbUShort(binaryEnsemble[41], binaryEnsemble[42]); ////// Temperature ////ensemble.AncillaryData.WaterTemp = MathHelper.LsbMsbUShort(binaryEnsemble[43], binaryEnsemble[44]) * 0.01f; ////ensemble.BottomTrackData.WaterTemp = MathHelper.LsbMsbUShort(binaryEnsemble[43], binaryEnsemble[44]) * 0.01f; ////ensemble.DvlData.WaterTemp = MathHelper.LsbMsbUShort(binaryEnsemble[43], binaryEnsemble[44]) * 0.01f; //#endregion //#region Bottom Track Velcocity //// X //if (MathHelper.LsbMsbShort(binaryEnsemble[2], binaryEnsemble[3]) == PD0.BAD_VELOCITY) //{ // ensemble.BottomTrackData.BeamVelocity[Ensemble.BEAM_0_INDEX] = Ensemble.BAD_VELOCITY; // ensemble.BottomTrackData.InstrumentVelocity[Ensemble.BEAM_X_INDEX] = Ensemble.BAD_VELOCITY; // ensemble.BottomTrackData.EarthVelocity[Ensemble.BEAM_EAST_INDEX] = Ensemble.BAD_VELOCITY; // ensemble.BottomTrackData.BeamGood[Ensemble.BEAM_0_INDEX] = 0.0f; // ensemble.BottomTrackData.EarthGood[Ensemble.BEAM_EAST_INDEX] = 0.0f; // ensemble.BottomTrackData.InstrumentGood[Ensemble.BEAM_X_INDEX] = 0.0f; // ensemble.DvlData.BtEastVelocity = Ensemble.BAD_VELOCITY; // ensemble.DvlData.BtXVelocity = Ensemble.BAD_VELOCITY; // ensemble.DvlData.BtTransverseVelocity = Ensemble.BAD_VELOCITY; // ensemble.DvlData.BtEarthIsGoodVelocity = false; // ensemble.DvlData.BtInstrumentIsGoodVelocity = false; // ensemble.DvlData.BtShipIsGoodVelocity = false; //} //else //{ // // Beam velocity // if (config.VelTransform == Core.Commons.Transforms.BEAM) // { // ensemble.BottomTrackData.BeamVelocity[Ensemble.BEAM_X_INDEX] = MathHelper.LsbMsbShort(binaryEnsemble[2], binaryEnsemble[3]) * 0.001f; // mm/s to m/s // ensemble.BottomTrackData.BeamGood[Ensemble.BEAM_X_INDEX] = 1.0f; // } // // Earth velocity // if (config.VelTransform == Core.Commons.Transforms.EARTH) // { // ensemble.BottomTrackData.EarthVelocity[Ensemble.BEAM_EAST_INDEX] = MathHelper.LsbMsbShort(binaryEnsemble[2], binaryEnsemble[3]) * 0.001f; // mm/s to m/s // ensemble.BottomTrackData.EarthGood[Ensemble.BEAM_EAST_INDEX] = 1.0f; // ensemble.DvlData.BtEastVelocity = MathHelper.LsbMsbShort(binaryEnsemble[2], binaryEnsemble[3]) * 0.001f; // mm/s to m/s // ensemble.DvlData.BtEarthIsGoodVelocity = true; // } // // Instrument velocity // if (config.VelTransform == Core.Commons.Transforms.INSTRUMENT) // { // ensemble.BottomTrackData.InstrumentVelocity[Ensemble.BEAM_X_INDEX] = MathHelper.LsbMsbShort(binaryEnsemble[5], binaryEnsemble[6]) * 0.001f; // mm/s to m/s // ensemble.BottomTrackData.InstrumentGood[Ensemble.BEAM_X_INDEX] = 1.0f; // ensemble.DvlData.BtXVelocity = MathHelper.LsbMsbShort(binaryEnsemble[5], binaryEnsemble[6]) * 0.001f; // mm/s to m/s // ensemble.DvlData.BtInstrumentIsGoodVelocity = true; // } // // Ship velocity // if (config.VelTransform == Core.Commons.Transforms.SHIP) // { // ensemble.DvlData.BtTransverseVelocity = MathHelper.LsbMsbShort(binaryEnsemble[5], binaryEnsemble[6]) * 0.001f; // mm/s to m/s // ensemble.DvlData.BtShipIsGoodVelocity = true; // } //} //// Y //if (MathHelper.LsbMsbShort(binaryEnsemble[7], binaryEnsemble[8]) == PD0.BAD_VELOCITY) //{ // ensemble.BottomTrackData.BeamVelocity[Ensemble.BEAM_1_INDEX] = Ensemble.BAD_VELOCITY; // ensemble.BottomTrackData.InstrumentVelocity[Ensemble.BEAM_Y_INDEX] = Ensemble.BAD_VELOCITY; // ensemble.BottomTrackData.EarthVelocity[Ensemble.BEAM_NORTH_INDEX] = Ensemble.BAD_VELOCITY; // ensemble.BottomTrackData.BeamGood[Ensemble.BEAM_1_INDEX] = 0.0f; // ensemble.BottomTrackData.EarthGood[Ensemble.BEAM_NORTH_INDEX] = 0.0f; // ensemble.BottomTrackData.InstrumentGood[Ensemble.BEAM_Y_INDEX] = 0.0f; // ensemble.DvlData.BtEastVelocity = Ensemble.BAD_VELOCITY; // ensemble.DvlData.BtXVelocity = Ensemble.BAD_VELOCITY; // ensemble.DvlData.BtLongitudinalVelocity = Ensemble.BAD_VELOCITY; //} //else //{ // // Beam velocity // if (config.VelTransform == Core.Commons.Transforms.BEAM) // { // ensemble.BottomTrackData.BeamVelocity[Ensemble.BEAM_1_INDEX] = MathHelper.LsbMsbShort(binaryEnsemble[7], binaryEnsemble[8]) * 0.001f; // mm/s to m/s // ensemble.BottomTrackData.BeamGood[Ensemble.BEAM_1_INDEX] = 1.0f; // } // // Earth velocity // if (config.VelTransform == Core.Commons.Transforms.EARTH) // { // ensemble.BottomTrackData.EarthVelocity[Ensemble.BEAM_NORTH_INDEX] = MathHelper.LsbMsbShort(binaryEnsemble[7], binaryEnsemble[8]) * 0.001f; // mm/s to m/s // ensemble.BottomTrackData.EarthGood[Ensemble.BEAM_NORTH_INDEX] = 1.0f; // ensemble.DvlData.BtNorthVelocity = MathHelper.LsbMsbShort(binaryEnsemble[7], binaryEnsemble[8]) * 0.001f; // mm/s to m/s // } // // Instrument velocity // if (config.VelTransform == Core.Commons.Transforms.INSTRUMENT) // { // ensemble.BottomTrackData.InstrumentVelocity[Ensemble.BEAM_Y_INDEX] = MathHelper.LsbMsbShort(binaryEnsemble[7], binaryEnsemble[8]) * 0.001f; // mm/s to m/s // ensemble.BottomTrackData.InstrumentGood[Ensemble.BEAM_Y_INDEX] = 1.0f; // ensemble.DvlData.BtYVelocity = MathHelper.LsbMsbShort(binaryEnsemble[7], binaryEnsemble[8]) * 0.001f; // mm/s to m/s // } // // Ship velocity // if (config.VelTransform == Core.Commons.Transforms.SHIP) // { // ensemble.DvlData.BtLongitudinalVelocity = MathHelper.LsbMsbShort(binaryEnsemble[7], binaryEnsemble[8]) * 0.001f; // mm/s to m/s // } //} //// Z //if (MathHelper.LsbMsbShort(binaryEnsemble[9], binaryEnsemble[10]) == PD0.BAD_VELOCITY) //{ // ensemble.BottomTrackData.BeamVelocity[Ensemble.BEAM_2_INDEX] = Ensemble.BAD_VELOCITY; // ensemble.BottomTrackData.InstrumentVelocity[Ensemble.BEAM_Z_INDEX] = Ensemble.BAD_VELOCITY; // ensemble.BottomTrackData.EarthVelocity[Ensemble.BEAM_VERTICAL_INDEX] = Ensemble.BAD_VELOCITY; // ensemble.BottomTrackData.BeamGood[Ensemble.BEAM_2_INDEX] = 0.0f; // ensemble.BottomTrackData.EarthGood[Ensemble.BEAM_VERTICAL_INDEX] = 0.0f; // ensemble.BottomTrackData.InstrumentGood[Ensemble.BEAM_Z_INDEX] = 0.0f; // ensemble.DvlData.BtUpwardVelocity = Ensemble.BAD_VELOCITY; // ensemble.DvlData.BtZVelocity = Ensemble.BAD_VELOCITY; // ensemble.DvlData.BtNormalVelocity = Ensemble.BAD_VELOCITY; //} //else //{ // // Beam velocity // if (config.VelTransform == Core.Commons.Transforms.BEAM) // { // ensemble.BottomTrackData.BeamVelocity[Ensemble.BEAM_2_INDEX] = MathHelper.LsbMsbShort(binaryEnsemble[9], binaryEnsemble[10]) * 0.001f; // mm/s to m/s // ensemble.BottomTrackData.BeamGood[Ensemble.BEAM_2_INDEX] = 1.0f; // } // // Earth velocity // if (config.VelTransform == Core.Commons.Transforms.EARTH) // { // ensemble.BottomTrackData.EarthVelocity[Ensemble.BEAM_VERTICAL_INDEX] = MathHelper.LsbMsbShort(binaryEnsemble[9], binaryEnsemble[10]) * 0.001f; // mm/s to m/s // ensemble.BottomTrackData.EarthGood[Ensemble.BEAM_VERTICAL_INDEX] = 1.0f; // ensemble.DvlData.BtUpwardVelocity = MathHelper.LsbMsbShort(binaryEnsemble[9], binaryEnsemble[10]) * 0.001f; // mm/s to m/s // } // // Instrument velocity // if (config.VelTransform == Core.Commons.Transforms.INSTRUMENT) // { // ensemble.BottomTrackData.InstrumentVelocity[Ensemble.BEAM_Z_INDEX] = MathHelper.LsbMsbShort(binaryEnsemble[9], binaryEnsemble[10]) * 0.001f; // mm/s to m/s // ensemble.BottomTrackData.InstrumentGood[Ensemble.BEAM_Z_INDEX] = 1.0f; // ensemble.DvlData.BtZVelocity = MathHelper.LsbMsbShort(binaryEnsemble[9], binaryEnsemble[10]) * 0.001f; // mm/s to m/s // } // // Ship velocity // if (config.VelTransform == Core.Commons.Transforms.SHIP) // { // ensemble.DvlData.BtNormalVelocity = MathHelper.LsbMsbShort(binaryEnsemble[9], binaryEnsemble[10]) * 0.001f; // mm/s to m/s // } //} //// Q //if (MathHelper.LsbMsbShort(binaryEnsemble[11], binaryEnsemble[12]) == PD0.BAD_VELOCITY) //{ // ensemble.BottomTrackData.BeamVelocity[Ensemble.BEAM_3_INDEX] = Ensemble.BAD_VELOCITY; // ensemble.BottomTrackData.InstrumentVelocity[Ensemble.BEAM_Q_INDEX] = Ensemble.BAD_VELOCITY; // ensemble.BottomTrackData.EarthVelocity[Ensemble.BEAM_Q_INDEX] = Ensemble.BAD_VELOCITY; // ensemble.BottomTrackData.BeamGood[Ensemble.BEAM_Q_INDEX] = 0.0f; // ensemble.BottomTrackData.EarthGood[Ensemble.BEAM_Q_INDEX] = 0.0f; // ensemble.BottomTrackData.InstrumentGood[Ensemble.BEAM_Q_INDEX] = 0.0f; // ensemble.DvlData.BtErrorVelocity = Ensemble.BAD_VELOCITY; //} //else //{ // // Beam velocity // if (config.VelTransform == Core.Commons.Transforms.BEAM) // { // ensemble.BottomTrackData.BeamVelocity[Ensemble.BEAM_3_INDEX] = MathHelper.LsbMsbShort(binaryEnsemble[11], binaryEnsemble[12]) * 0.001f; // mm/s to m/s // ensemble.BottomTrackData.BeamGood[Ensemble.BEAM_3_INDEX] = 1.0f; // } // // Earth velocity // if (config.VelTransform == Core.Commons.Transforms.EARTH) // { // ensemble.BottomTrackData.EarthVelocity[Ensemble.BEAM_Q_INDEX] = MathHelper.LsbMsbShort(binaryEnsemble[11], binaryEnsemble[12]) * 0.001f; // mm/s to m/s // ensemble.BottomTrackData.EarthGood[Ensemble.BEAM_Q_INDEX] = 1.0f; // ensemble.DvlData.BtErrorVelocity = MathHelper.LsbMsbShort(binaryEnsemble[11], binaryEnsemble[12]) * 0.001f; // mm/s to m/s // } // // Instrument velocity // if (config.VelTransform == Core.Commons.Transforms.INSTRUMENT) // { // ensemble.BottomTrackData.InstrumentVelocity[Ensemble.BEAM_Q_INDEX] = MathHelper.LsbMsbShort(binaryEnsemble[11], binaryEnsemble[12]) * 0.001f; // mm/s to m/s // ensemble.BottomTrackData.InstrumentGood[Ensemble.BEAM_Q_INDEX] = 1.0f; // ensemble.DvlData.BtErrorVelocity = MathHelper.LsbMsbShort(binaryEnsemble[11], binaryEnsemble[12]) * 0.001f; // mm/s to m/s // } // // Ship velocity // if (config.VelTransform == Core.Commons.Transforms.SHIP) // { // } //} //// Range //ensemble.BottomTrackData.Range[Ensemble.BEAM_0_INDEX] = MathHelper.LsbMsbUShort(binaryEnsemble[13], binaryEnsemble[14]) * 0.01f; // cm to m //ensemble.BottomTrackData.Range[Ensemble.BEAM_1_INDEX] = MathHelper.LsbMsbUShort(binaryEnsemble[15], binaryEnsemble[16]) * 0.01f; // cm to m //ensemble.BottomTrackData.Range[Ensemble.BEAM_2_INDEX] = MathHelper.LsbMsbUShort(binaryEnsemble[17], binaryEnsemble[18]) * 0.01f; // cm to m //ensemble.BottomTrackData.Range[Ensemble.BEAM_3_INDEX] = MathHelper.LsbMsbUShort(binaryEnsemble[19], binaryEnsemble[20]) * 0.01f; // cm to m //ensemble.DvlData.RangeBeam0 = MathHelper.LsbMsbUShort(binaryEnsemble[13], binaryEnsemble[14]) * 0.01f; // cm to m //ensemble.DvlData.RangeBeam1 = MathHelper.LsbMsbUShort(binaryEnsemble[15], binaryEnsemble[16]) * 0.01f; // cm to m //ensemble.DvlData.RangeBeam2 = MathHelper.LsbMsbUShort(binaryEnsemble[17], binaryEnsemble[18]) * 0.01f; // cm to m //ensemble.DvlData.RangeBeam3 = MathHelper.LsbMsbUShort(binaryEnsemble[19], binaryEnsemble[20]) * 0.01f; // cm to m //#endregion //#region Ensemble Time //// Ensemble time //int hour = binaryEnsemble[35]; //int min = binaryEnsemble[36]; //int sec = binaryEnsemble[37]; //int hun = binaryEnsemble[38]; //ensemble.EnsembleData.Hour = hour; //ensemble.EnsembleData.Minute = min; //ensemble.EnsembleData.Second = sec; //ensemble.EnsembleData.HSec = hun; //ensemble.DvlData.Hour = hour; //ensemble.DvlData.Minute = min; //ensemble.DvlData.Second = sec; //ensemble.DvlData.HSec = hun; //// Time of first ping //float currTime = (hour * 3600.0f) + (min * 60.0f) + sec + (hun * 0.01f); //ensemble.AncillaryData.FirstPingTime = currTime - _prevTime; //ensemble.AncillaryData.LastPingTime = currTime - _prevTime; //ensemble.BottomTrackData.FirstPingTime = currTime - _prevTime; //ensemble.BottomTrackData.LastPingTime = currTime - _prevTime; //// Set the prev time if it has not been set //if (_prevTime == 0) //{ // _prevTime = currTime; //} //#endregion //#region Reference Layer Data //#region Earth //// Add the proper DataSet //if(config.VelTransform == Core.Commons.Transforms.EARTH) //{ // // Add Earth Water Mass // if (!ensemble.IsEarthWaterMassAvail) // { // ensemble.EarthWaterMassData = new EarthWaterMassDataSet(); // ensemble.IsEarthWaterMassAvail = true; // } // // East // if (MathHelper.LsbMsbShort(binaryEnsemble[22], binaryEnsemble[23]) == PD0.BAD_VELOCITY) // { // ensemble.EarthWaterMassData.VelocityEast = Ensemble.BAD_VELOCITY; // ensemble.DvlData.WmEastVelocity = Ensemble.BAD_VELOCITY; // } // else // { // ensemble.EarthWaterMassData.VelocityEast = MathHelper.LsbMsbShort(binaryEnsemble[22], binaryEnsemble[23]) * 0.001f; // mm/s to m/s // ensemble.DvlData.WmEastVelocity = MathHelper.LsbMsbShort(binaryEnsemble[22], binaryEnsemble[23]) * 0.001f; // mm/s to m/s // } // // North // if (MathHelper.LsbMsbShort(binaryEnsemble[24], binaryEnsemble[25]) == PD0.BAD_VELOCITY) // { // ensemble.EarthWaterMassData.VelocityNorth = Ensemble.BAD_VELOCITY; // ensemble.DvlData.WmNorthVelocity = Ensemble.BAD_VELOCITY; // } // else // { // ensemble.EarthWaterMassData.VelocityNorth = MathHelper.LsbMsbShort(binaryEnsemble[24], binaryEnsemble[25]) * 0.001f; // mm/s to m/s // ensemble.DvlData.WmNorthVelocity = MathHelper.LsbMsbShort(binaryEnsemble[24], binaryEnsemble[25]) * 0.001f; // mm/s to m/s // } // // Vertical // if (MathHelper.LsbMsbShort(binaryEnsemble[26], binaryEnsemble[27]) == PD0.BAD_VELOCITY) // { // ensemble.EarthWaterMassData.VelocityVertical = Ensemble.BAD_VELOCITY; // ensemble.DvlData.WmUpwardVelocity = Ensemble.BAD_VELOCITY; // } // else // { // ensemble.EarthWaterMassData.VelocityVertical = MathHelper.LsbMsbShort(binaryEnsemble[26], binaryEnsemble[27]) * 0.001f; // mm/s to m/s // ensemble.DvlData.WmUpwardVelocity = MathHelper.LsbMsbShort(binaryEnsemble[26], binaryEnsemble[27]) * 0.001f; // mm/s to m/s // } // // Depth layer // ensemble.EarthWaterMassData.WaterMassDepthLayer = MathHelper.LsbMsbShort(binaryEnsemble[30], binaryEnsemble[31]) * 0.1f; // dm to m // ensemble.DvlData.RefLayerMin = (int)(MathHelper.LsbMsbUShort(binaryEnsemble[30], binaryEnsemble[31]) * 0.1f); // dm to m // ensemble.DvlData.RefLayerMax = (int)(MathHelper.LsbMsbUShort(binaryEnsemble[32], binaryEnsemble[33]) * 0.1f); // dm to m //} //#endregion //#region Instrument //if (config.VelTransform == Core.Commons.Transforms.INSTRUMENT) //{ // // Add Instrument Water Mass // if (!ensemble.IsInstrumentWaterMassAvail) // { // ensemble.InstrumentWaterMassData = new InstrumentWaterMassDataSet(); // ensemble.IsInstrumentWaterMassAvail = true; // } // // X // if (MathHelper.LsbMsbShort(binaryEnsemble[22], binaryEnsemble[23]) == PD0.BAD_VELOCITY) // { // ensemble.InstrumentWaterMassData.VelocityX = Ensemble.BAD_VELOCITY; // ensemble.DvlData.WmXVelocity = Ensemble.BAD_VELOCITY; // } // else // { // ensemble.InstrumentWaterMassData.VelocityX = MathHelper.LsbMsbShort(binaryEnsemble[22], binaryEnsemble[23]) * 0.001f; // mm/s to m/s // ensemble.DvlData.WmXVelocity = MathHelper.LsbMsbShort(binaryEnsemble[22], binaryEnsemble[23]) * 0.001f; // mm/s to m/s // } // // Y // if (MathHelper.LsbMsbShort(binaryEnsemble[24], binaryEnsemble[25]) == PD0.BAD_VELOCITY) // { // ensemble.InstrumentWaterMassData.VelocityY = Ensemble.BAD_VELOCITY; // ensemble.DvlData.WmYVelocity = Ensemble.BAD_VELOCITY; // } // else // { // ensemble.InstrumentWaterMassData.VelocityY = MathHelper.LsbMsbShort(binaryEnsemble[24], binaryEnsemble[25]) * 0.001f; // mm/s to m/s // ensemble.DvlData.WmYVelocity = MathHelper.LsbMsbShort(binaryEnsemble[24], binaryEnsemble[25]) * 0.001f; // mm/s to m/s // } // // Z // if (MathHelper.LsbMsbShort(binaryEnsemble[26], binaryEnsemble[27]) == PD0.BAD_VELOCITY) // { // ensemble.InstrumentWaterMassData.VelocityZ = Ensemble.BAD_VELOCITY; // ensemble.DvlData.WmZVelocity = Ensemble.BAD_VELOCITY; // } // else // { // ensemble.InstrumentWaterMassData.VelocityZ = MathHelper.LsbMsbShort(binaryEnsemble[26], binaryEnsemble[27]) * 0.001f; // mm/s to m/s // ensemble.DvlData.WmZVelocity = MathHelper.LsbMsbShort(binaryEnsemble[26], binaryEnsemble[27]) * 0.001f; // mm/s to m/s // } // // Error // if (MathHelper.LsbMsbShort(binaryEnsemble[28], binaryEnsemble[29]) == PD0.BAD_VELOCITY) // { // ensemble.InstrumentWaterMassData.VelocityQ = Ensemble.BAD_VELOCITY; // } // else // { // ensemble.InstrumentWaterMassData.VelocityQ = MathHelper.LsbMsbShort(binaryEnsemble[28], binaryEnsemble[29]) * 0.001f; // mm/s to m/s // } // // Depth layer // ensemble.InstrumentWaterMassData.WaterMassDepthLayer = MathHelper.LsbMsbShort(binaryEnsemble[30], binaryEnsemble[31]) * 0.1f; // dm to m // ensemble.DvlData.RefLayerMin = (int)(MathHelper.LsbMsbUShort(binaryEnsemble[30], binaryEnsemble[31]) * 0.1f); // dm to m // ensemble.DvlData.RefLayerMax = (int)(MathHelper.LsbMsbUShort(binaryEnsemble[32], binaryEnsemble[33]) * 0.1f); // dm to m //} //#endregion //#endregion //#region PD5 //// If PD5 //// PD5 will have more bytes than PD4 //if(binaryEnsemble.Length >= PD5_ENS_SIZE) //{ // // Decode PD5 values // // Salinity // ensemble.AncillaryData.Salinity = binaryEnsemble[45]; // ensemble.BottomTrackData.Salinity = binaryEnsemble[45]; // ensemble.DvlData.Salinity = binaryEnsemble[45]; // // Tranducer Depth // ensemble.AncillaryData.TransducerDepth = MathHelper.LsbMsbUShort(binaryEnsemble[46], binaryEnsemble[47]) * 0.1f; // ensemble.BottomTrackData.TransducerDepth = MathHelper.LsbMsbUShort(binaryEnsemble[46], binaryEnsemble[47]) * 0.1f; // ensemble.DvlData.TransducerDepth = MathHelper.LsbMsbUShort(binaryEnsemble[46], binaryEnsemble[47]) * 0.1f; // // Heading // ensemble.AncillaryData.Heading = MathHelper.LsbMsbUShort(binaryEnsemble[52], binaryEnsemble[53]) * 0.01f; // ensemble.BottomTrackData.Heading = MathHelper.LsbMsbUShort(binaryEnsemble[52], binaryEnsemble[53]) * 0.01f; // ensemble.DvlData.Heading = MathHelper.LsbMsbUShort(binaryEnsemble[52], binaryEnsemble[53]) * 0.01f; // // Pitch // ensemble.AncillaryData.Pitch = MathHelper.LsbMsbShort(binaryEnsemble[48], binaryEnsemble[49]) * 0.01f; // ensemble.BottomTrackData.Pitch = MathHelper.LsbMsbShort(binaryEnsemble[48], binaryEnsemble[49]) * 0.01f; // ensemble.DvlData.Pitch = MathHelper.LsbMsbShort(binaryEnsemble[48], binaryEnsemble[49]) * 0.01f; // // Roll // ensemble.AncillaryData.Roll = MathHelper.LsbMsbShort(binaryEnsemble[50], binaryEnsemble[51]) * 0.01f; // ensemble.BottomTrackData.Roll = MathHelper.LsbMsbShort(binaryEnsemble[50], binaryEnsemble[51]) * 0.01f; // ensemble.DvlData.Roll = MathHelper.LsbMsbShort(binaryEnsemble[50], binaryEnsemble[51]) * 0.01f; // // DMG // ensemble.DvlData.DmgEast = MathHelper.ByteArrayToInt32(binaryEnsemble, 54) * 0.1f; // dm to m // ensemble.DvlData.DmgNorth = MathHelper.ByteArrayToInt32(binaryEnsemble, 58) * 0.1f; // dm to m // ensemble.DvlData.DmgUpward = MathHelper.ByteArrayToInt32(binaryEnsemble, 62) * 0.1f; // dm to m // ensemble.DvlData.DmgError = MathHelper.ByteArrayToInt32(binaryEnsemble, 66) * 0.1f; // dm to m // // DMG Ref Layer // ensemble.DvlData.DmgRefEast = MathHelper.ByteArrayToInt32(binaryEnsemble, 70) * 0.1f; // dm to m // ensemble.DvlData.DmgRefNorth = MathHelper.ByteArrayToInt32(binaryEnsemble, 74) * 0.1f; // dm to m // ensemble.DvlData.DmgRefUpward = MathHelper.ByteArrayToInt32(binaryEnsemble, 78) * 0.1f; // dm to m // ensemble.DvlData.DmgRefError = MathHelper.ByteArrayToInt32(binaryEnsemble, 82) * 0.1f; // dm to m //} //#endregion // Send an event that data was processed // in this format if (ProcessDataEvent != null) { ProcessDataEvent(binaryEnsemble, ensemble); } return ensemble; }
private void LoadFromConfig(string ConfigPath) { SystemConfig sc = new SystemConfig(); sc.LoadFromFile(ConfigPath); LoadFromDB(sc.DBPath); }
public void UpdateParamatricBusinessRules(ParamatricBusinessRulesModelDto model) { // COMMISSION_LEVELS var systemConfig_COMMISSION_LEVELS = Repository.Query<SystemConfig>().FirstOrDefault(a => a.Name.Equals(ParamatricBusinessRules.COMMISSION_LEVELS.ToString())); if (systemConfig_COMMISSION_LEVELS != null) { systemConfig_COMMISSION_LEVELS.Value = Utilities.RemoveCommaSymbol(model.CommissionLevels); Repository.Update<SystemConfig>(systemConfig_COMMISSION_LEVELS); } else { systemConfig_COMMISSION_LEVELS = new SystemConfig() { CreatedDate = DateTime.UtcNow, ModifiedDate = DateTime.UtcNow, Name = ParamatricBusinessRules.COMMISSION_LEVELS.ToString(), Value = model.CommissionLevels.ToString() }; Repository.Insert<SystemConfig>(systemConfig_COMMISSION_LEVELS); } var systemConfig_FILE_UPLOAD_LIMITS = Repository.Query<SystemConfig>().FirstOrDefault(a => a.Name.Equals(ParamatricBusinessRules.FILE_UPLOAD_LIMITS.ToString())); if (systemConfig_FILE_UPLOAD_LIMITS != null) { systemConfig_FILE_UPLOAD_LIMITS.Value = Utilities.RemoveCommaSymbol(model.FileUploadLimits); Repository.Update<SystemConfig>(systemConfig_FILE_UPLOAD_LIMITS); } else { systemConfig_FILE_UPLOAD_LIMITS = new SystemConfig() { CreatedDate = DateTime.UtcNow, ModifiedDate = DateTime.UtcNow, Name = ParamatricBusinessRules.FILE_UPLOAD_LIMITS.ToString(), Value = model.FileUploadLimits.ToString() }; Repository.Insert<SystemConfig>(systemConfig_FILE_UPLOAD_LIMITS); } // BASIC_FEE var systemConfig_BASIC_FEE = Repository.Query<SystemConfig>().FirstOrDefault(a => a.Name.Equals(ParamatricBusinessRules.BASIC_FEE.ToString())); if (systemConfig_BASIC_FEE != null) { systemConfig_BASIC_FEE.Value = Utilities.RemoveCommaSymbol(model.BasicFee); Repository.Update<SystemConfig>(systemConfig_BASIC_FEE); } else { systemConfig_BASIC_FEE = new SystemConfig() { CreatedDate = DateTime.UtcNow, ModifiedDate = DateTime.UtcNow, Name = ParamatricBusinessRules.BASIC_FEE.ToString(), Value = model.BasicFee.ToString() }; Repository.Insert<SystemConfig>(systemConfig_BASIC_FEE); } // STARTING_TIME var systemConfig_STARTING_TIME = Repository.Query<SystemConfig>().FirstOrDefault(a => a.Name.Equals(ParamatricBusinessRules.STARTING_TIME.ToString())); if (systemConfig_STARTING_TIME != null) { systemConfig_STARTING_TIME.Value = Utilities.RemoveCommaSymbol(model.StartingTime); Repository.Update<SystemConfig>(systemConfig_STARTING_TIME); } else { systemConfig_STARTING_TIME = new SystemConfig() { CreatedDate = DateTime.UtcNow, ModifiedDate = DateTime.UtcNow, Name = ParamatricBusinessRules.STARTING_TIME.ToString(), Value = model.StartingTime.ToString() }; Repository.Insert<SystemConfig>(systemConfig_STARTING_TIME); } // MINIMUM_BOOKING var systemConfig_MINIMUM_BOOKING = Repository.Query<SystemConfig>().FirstOrDefault(a => a.Name.Equals(ParamatricBusinessRules.MINIMUM_BOOKING.ToString())); if (systemConfig_MINIMUM_BOOKING != null) { systemConfig_MINIMUM_BOOKING.Value = Utilities.RemoveCommaSymbol(model.MinimumBooking); Repository.Update<SystemConfig>(systemConfig_MINIMUM_BOOKING); } else { systemConfig_MINIMUM_BOOKING = new SystemConfig() { CreatedDate = DateTime.UtcNow, ModifiedDate = DateTime.UtcNow, Name = ParamatricBusinessRules.MINIMUM_BOOKING.ToString(), Value = model.MinimumBooking.ToString() }; Repository.Insert<SystemConfig>(systemConfig_MINIMUM_BOOKING); } // MAXIMUM_BOOKING var systemConfig_MAXIMUM_BOOKING = Repository.Query<SystemConfig>().FirstOrDefault(a => a.Name.Equals(ParamatricBusinessRules.MAXIMUM_BOOKING.ToString())); if (systemConfig_MAXIMUM_BOOKING != null) { systemConfig_MAXIMUM_BOOKING.Value = Utilities.RemoveCommaSymbol(model.MaximumBooking); Repository.Update<SystemConfig>(systemConfig_MAXIMUM_BOOKING); } else { systemConfig_MAXIMUM_BOOKING = new SystemConfig() { CreatedDate = DateTime.UtcNow, ModifiedDate = DateTime.UtcNow, Name = ParamatricBusinessRules.MAXIMUM_BOOKING.ToString(), Value = model.MaximumBooking.ToString() }; Repository.Insert<SystemConfig>(systemConfig_MAXIMUM_BOOKING); } // MINIMUM_LEAD_TIME var systemConfig_MINIMUM_LEAD_TIME = Repository.Query<SystemConfig>().FirstOrDefault(a => a.Name.Equals(ParamatricBusinessRules.MINIMUM_LEAD_TIME.ToString())); if (systemConfig_MINIMUM_LEAD_TIME != null) { systemConfig_MINIMUM_LEAD_TIME.Value = Utilities.RemoveCommaSymbol(model.MinimumLeadTime); Repository.Update<SystemConfig>(systemConfig_MINIMUM_LEAD_TIME); } else { systemConfig_MINIMUM_LEAD_TIME = new SystemConfig() { CreatedDate = DateTime.UtcNow, ModifiedDate = DateTime.UtcNow, Name = ParamatricBusinessRules.MINIMUM_LEAD_TIME.ToString(), Value = model.MinimumLeadTime.ToString() }; Repository.Insert<SystemConfig>(systemConfig_MINIMUM_LEAD_TIME); } // MAXIMUM_LEAD_TIME var systemConfig_MAXIMUM_LEAD_TIME = Repository.Query<SystemConfig>().FirstOrDefault(a => a.Name.Equals(ParamatricBusinessRules.MAXIMUM_LEAD_TIME.ToString())); if (systemConfig_MAXIMUM_LEAD_TIME != null) { systemConfig_MAXIMUM_LEAD_TIME.Value = Utilities.RemoveCommaSymbol(model.MaximumLeadTime); Repository.Update<SystemConfig>(systemConfig_MAXIMUM_LEAD_TIME); } else { systemConfig_MAXIMUM_LEAD_TIME = new SystemConfig() { CreatedDate = DateTime.UtcNow, ModifiedDate = DateTime.UtcNow, Name = ParamatricBusinessRules.MAXIMUM_LEAD_TIME.ToString(), Value = model.MaximumLeadTime.ToString() }; Repository.Insert<SystemConfig>(systemConfig_MAXIMUM_LEAD_TIME); } // MAXIMUM_LEAD_TIME var systemPrepaymentMinValue = Repository.Query<SystemConfig>().FirstOrDefault(a => a.Name.Equals(ParamatricBusinessRules.PREPAYMENT_MINIMUM_VALUE.ToString())); if (systemPrepaymentMinValue != null) { systemPrepaymentMinValue.Value = Utilities.RemoveCommaSymbol(model.PrepaymentMinimumValue); Repository.Update<SystemConfig>(systemPrepaymentMinValue); } else { systemPrepaymentMinValue = new SystemConfig() { CreatedDate = DateTime.UtcNow, ModifiedDate = DateTime.UtcNow, Name = ParamatricBusinessRules.PREPAYMENT_MINIMUM_VALUE.ToString(), Value = model.PrepaymentMinimumValue.ToString() }; Repository.Insert<SystemConfig>(systemPrepaymentMinValue); } // DEFER_DAYS_FOR_RCTI var systemDeferDaysForRCTI = Repository.Query<SystemConfig>().FirstOrDefault(a => a.Name.Equals(ParamatricBusinessRules.DEFER_DAYS_FOR_RCTI.ToString())); if (systemDeferDaysForRCTI != null) { systemDeferDaysForRCTI.Value = Utilities.RemoveCommaSymbol(model.DeferredDaysForRCTI); Repository.Update<SystemConfig>(systemDeferDaysForRCTI); } else { systemDeferDaysForRCTI = new SystemConfig() { CreatedDate = DateTime.UtcNow, ModifiedDate = DateTime.UtcNow, Name = ParamatricBusinessRules.DEFER_DAYS_FOR_RCTI.ToString(), Value = model.DeferredDaysForRCTI.ToString() }; Repository.Insert<SystemConfig>(systemDeferDaysForRCTI); } // TRANSCRIPTION COST var systemTranscriptionCost = Repository.Query<SystemConfig>().FirstOrDefault(a => a.Name.Equals(ParamatricBusinessRules.TRANSCRIPTION_COST.ToString())); if (systemTranscriptionCost != null) { systemTranscriptionCost.Value = Utilities.RemoveCommaSymbol(model.TranscriptionCost); Repository.Update<SystemConfig>(systemTranscriptionCost); } else { systemTranscriptionCost = new SystemConfig() { CreatedDate = DateTime.UtcNow, ModifiedDate = DateTime.UtcNow, Name = ParamatricBusinessRules.TRANSCRIPTION_COST.ToString(), Value = model.DeferredDaysForRCTI.ToString() }; Repository.Insert<SystemConfig>(systemTranscriptionCost); } // GST var systemGST = Repository.Query<SystemConfig>().FirstOrDefault(a => a.Name.Equals(ParamatricBusinessRules.GST_RATE.ToString())); if (systemGST != null) { systemGST.Value = Utilities.RemoveCommaSymbol(model.GST); Repository.Update<SystemConfig>(systemGST); } else { systemGST = new SystemConfig() { CreatedDate = DateTime.UtcNow, ModifiedDate = DateTime.UtcNow, Name = ParamatricBusinessRules.GST_RATE.ToString(), Value = model.GST.ToString() }; Repository.Insert<SystemConfig>(systemGST); } // VOICE_IN_CONFERENCE var systemVoiceInConference = Repository.Query<SystemConfig>().FirstOrDefault(a => a.Name.Equals(ParamatricBusinessRules.VOICE_IN_CONFERENCE.ToString())); if (systemVoiceInConference != null) { systemVoiceInConference.Value = Utilities.RemoveCommaSymbol(model.Voice); Repository.Update<SystemConfig>(systemVoiceInConference); } else { systemVoiceInConference = new SystemConfig() { CreatedDate = DateTime.UtcNow, ModifiedDate = DateTime.UtcNow, Name = ParamatricBusinessRules.VOICE_IN_CONFERENCE.ToString(), Value = model.Voice.ToString() }; Repository.Insert<SystemConfig>(systemVoiceInConference); } // LANGUAGE_IN_CONFERENCE var systemLanguageInConference = Repository.Query<SystemConfig>().FirstOrDefault(a => a.Name.Equals(ParamatricBusinessRules.LANGUAGE_IN_CONFERENCE.ToString())); if (systemLanguageInConference != null) { systemLanguageInConference.Value = Utilities.RemoveCommaSymbol(model.Language); Repository.Update<SystemConfig>(systemLanguageInConference); } else { systemLanguageInConference = new SystemConfig() { CreatedDate = DateTime.UtcNow, ModifiedDate = DateTime.UtcNow, Name = ParamatricBusinessRules.LANGUAGE_IN_CONFERENCE.ToString(), Value = model.Language.ToString() }; Repository.Insert<SystemConfig>(systemLanguageInConference); } UnitOfWork.Save(); }
/// <summary>获取生成运行时变量的函数 /// </summary> /// <returns></returns> internal static Func<string, IDictionary<string, object>> GetHowToGenerateRuntimeProperties(SystemConfig config) { return flag => { //HACK:以下的key的可以在log4net中使用 %property{key} var dict = new Dictionary<string, object>(); dict.Add("appName", config.AppName); dict.Add("versionFlag", config.VersionFlag); dict.Add("host", Environment.MachineName); //仅当错误级别的log才提供的信息 //if (flag == CodeSharp.Core.Configuration.RuntimeProperties_Environment_Error) // dict.Add("httpDump", new HttpDump()); //else // dict.Add("httpDump", ""); return dict; }; }
public SpydeeCore(SystemConfig sc) { _config = sc; this._scanState = WorkState.Stopped; }
public SystemConfig Add(SystemConfig systemConfig) { return(_systemConfigRepository.Add(systemConfig)); }
public void TestXMLReaderDialogConfig() { SystemConfig sc = XMLHelper.ReadXmlConfig <SystemConfig>("SystemConfig.xml"); // Mike - moved the Dialogs tests into ToolConfig testing since those are no longer in SystemConfig }
/// <summary>启用castle作为容器化架构的默认容器 /// <remarks> /// 若您决定启用容器, /// 强烈建议SystemConfig.Configure(app)之后立刻声明Castle()再进行其他特性的配置, /// 以确保您启用的特性能顺利享受到容器带来的变化 /// 如:SystemConfig.Configure().Castle().DefaultAppAgent(); /// </remarks> /// </summary> /// <param name="config"></param> /// <returns></returns> public static SystemConfigWithCastle Castle(this SystemConfig config) { return(SystemConfig.Configure(new SystemConfigWithCastle(config)) as SystemConfigWithCastle); }
public MFStartParams(SystemConfig _sc) { SystemConfig = _sc; }
public static IServiceCollection RegisterJTTServer(this IServiceCollection services, SystemConfig config) { services.AddJTT(options => { options.ProtocolOptions = new SuperSocket.JTT.Server.Model.JTTProtocolOptions { Version = config.JTTVersion, JTTCustomAssemblyName = Assembly.GetExecutingAssembly().GetName().Name, ConfigFilePath = config.JTTConfigFilePath, Structures = config.Structures, DataMappings = config.DataMappings, InternalEntitysMappings = config.InternalEntitysMappings, }; options.ServerOptions = new SuperSocket.JTT.Server.Model.JTTServerOptions { Name = config.ServerName, IP = config.ServerIP, Port = config.ServerPort, BackLog = config.ServerBackLog, UseUdp = true, PackageHandler = PackageHandler.Handler, OnConnected = SessionHandler.OnConnected, OnClosed = SessionHandler.OnClosed, InProcSessionContainer = true, ConfigureServices = (context, services, protocol) => { }, ConfigureAppConfiguration = (hostCtx, configApp, protocol) => { } }; options.LoggingOptions = new SuperSocket.JTT.Server.Model.JTTLoggingOptions { AddConsole = true, AddDebug = true, Provider = AutofacHelper.GetService <ILoggerProvider>() }; }); return(services); }
public static extern bool GetSystemConfig(int GroupID, ref SystemConfig SysCfg, bool GetDriverCopy);
public IndexerCore(SystemConfig sc) : base(sc) { _config = sc; }
public static extern bool SetSystemConfig(int GroupID, ref SystemConfig SysCfg);
public static IocConfig GetConfig() { var config = SystemConfig.GetConfig <IocConfig>("ioc"); return(config); }
public GameConfig() { System = new SystemConfig(); VESA = new VESAConfig(); Albion = new AlbionConfig(); }
public UserCustomDataManager(ExtensibleDbContext dbCtx) { _dbCtx = dbCtx; _config = SystemConfig.LoadConfig(); _canvasDataAccess = new CanvasDataAccess(_config); }
private void CashConfig() { SystemConfig config = _mainTemplatePresenter.cashConfig(); }
private void savebtn_Click(object sender, EventArgs e) { detectionmode.modename = namebox.Text; if (detectionpath != "") { if (!System.IO.File.Exists(detectionpath)) { MessageShow.show("Current path doesn't exist ", "当前路径不存在"); return; } if (treechan != null && chanPara != null && detectionmode != null) { string date = string.Format("{0:yyyy-MM-dd HH_mm_ss}", DateTime.Now); date = DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss");//"G" SystemConfig.WriteConfigData(detectionpath, "date", date); SystemConfig.WriteBase64Data(detectionpath, "treechan", treechan); SystemConfig.WriteBase64Data(detectionpath, "chanPara", chanPara); SystemConfig.WriteBase64Data(detectionpath, "detectionmode", detectionmode); } else { MessageShow.show("Please check Data", "请检查数据是否正确"); } } else { SaveFileDialog bsSaveDialog = new SaveFileDialog(); string filepath = Application.StartupPath + @"\DetectionMode"; bsSaveDialog.Filter = "xml文件(*.xml)|*.xml|所有文件(*.*)|*.*"; if (!Directory.Exists(filepath)) { try { Directory.CreateDirectory(filepath); } catch { filepath = Application.StartupPath; } } bsSaveDialog.InitialDirectory = filepath; bsSaveDialog.FilterIndex = 1; bsSaveDialog.FileName = namebox.Text; if (bsSaveDialog.ShowDialog() == DialogResult.OK) { String filename = bsSaveDialog.FileName; if (treechan != null && chanPara != null && detectionmode != null) { string date = string.Format("{0:yyyy-MM-dd HH_mm_ss}", DateTime.Now); date = DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss");//"G" SystemConfig.WriteConfigData(filename, "date", date); SystemConfig.WriteBase64Data(filename, "treechan", treechan); SystemConfig.WriteBase64Data(filename, "chanPara", chanPara); SystemConfig.WriteBase64Data(filename, "detectionmode", detectionmode); detectionpath = filename; } else { MessageShow.show("Please check Data", "请检查数据是否正确"); } } } }
static void Main(string[] args) { SimpleLogger.Instance.Info("--------------------------------------------------------------"); SimpleLogger.Instance.Info(Environment.CommandLine); try { SetProcessDPIAware(); } catch { } LocalPath = Path.GetDirectoryName(typeof(Program).Assembly.Location); AppConfig = ConfigFile.FromFile(Path.Combine(LocalPath, "emulatorLauncher.cfg")); AppConfig.ImportOverrides(ConfigFile.FromArguments(args)); SystemConfig = ConfigFile.LoadEmulationStationSettings(Path.Combine(Program.AppConfig.GetFullPath("home"), "es_settings.cfg")); SystemConfig.ImportOverrides(ConfigFile.FromArguments(args)); SystemConfig.ImportOverrides(SystemConfig.LoadAll("global")); SystemConfig.ImportOverrides(SystemConfig.LoadAll(SystemConfig["system"])); SystemConfig.ImportOverrides(SystemConfig.LoadAll(SystemConfig["system"] + "[\"" + Path.GetFileName(SystemConfig["rom"]) + "\"]")); SystemConfig.ImportOverrides(ConfigFile.FromArguments(args)); var inputConfig = LoadControllerConfiguration(args); ImportShaderOverrides(); if (!SystemConfig.isOptSet("rom")) { SimpleLogger.Instance.Error("rom not set"); return; } if (!File.Exists(SystemConfig.GetFullPath("rom")) && !Directory.Exists(SystemConfig.GetFullPath("rom"))) { SimpleLogger.Instance.Error("rom does not exist"); return; } if (!SystemConfig.isOptSet("system")) { SimpleLogger.Instance.Error("system not set"); return; } if (string.IsNullOrEmpty(SystemConfig["emulator"])) { SystemConfig["emulator"] = SystemDefaults.GetDefaultEmulator(SystemConfig["system"]); } if (string.IsNullOrEmpty(SystemConfig["core"])) { SystemConfig["core"] = SystemDefaults.GetDefaultCore(SystemConfig["system"]); } if (string.IsNullOrEmpty(SystemConfig["emulator"])) { SystemConfig["emulator"] = SystemConfig["system"]; } Generator generator = generators.Where(g => g.Key == SystemConfig["emulator"]).Select(g => g.Value()).FirstOrDefault(); if (generator == null && !string.IsNullOrEmpty(SystemConfig["emulator"]) && SystemConfig["emulator"].StartsWith("lr-")) { generator = new LibRetroGenerator(); } if (generator == null) { generator = generators.Where(g => g.Key == SystemConfig["system"]).Select(g => g.Value()).FirstOrDefault(); } if (generator != null) { using (var screenResolution = ScreenResolution.Parse(SystemConfig["videomode"])) { ProcessStartInfo path = generator.Generate(SystemConfig["system"], SystemConfig["emulator"], SystemConfig["core"], SystemConfig["rom"], null, screenResolution); if (path != null) { if (path.Arguments != null) { SimpleLogger.Instance.Info("-> " + path.FileName + " " + path.Arguments); } else { SimpleLogger.Instance.Info("-> " + path.FileName); } path.UseShellExecute = true; if (screenResolution != null && generator.DependsOnDesktopResolution) { screenResolution.Apply(); } Cursor.Position = new System.Drawing.Point(Screen.PrimaryScreen.Bounds.Right, Screen.PrimaryScreen.Bounds.Bottom / 2); PadToKey mapping = null; if (generator.UsePadToKey) { mapping = PadToKey.Load(Path.Combine(Program.AppConfig.GetFullPath("home"), "es_padtokey.cfg")); } mapping = LoadGamePadToKeyMapping(path, mapping); mapping = generator.SetupCustomPadToKeyMapping(mapping); using (new HighPerformancePowerScheme()) using (new JoystickListener(inputConfig, mapping)) generator.RunAndWait(path); } else { SimpleLogger.Instance.Error("generator failed"); } } generator.Cleanup(); } else { SimpleLogger.Instance.Error("cant find generator"); } }
private Boolean StaffFormBind() { string qryString = "Select staff_id,sLoginID,sLoginPW,position,staffNbr,sName,DeptName,sClass,subJobs,phone,cellularP,ExtNbr,sEmail,SSN,zipcode,address" + ",homepage,mark,sLevel,sBusinessPic,sAvataImage,sData,joinDT" + " FROM t_Staff" + " WHERE staff_id=" + _sfID; qryString += ";Select annGroup,itemFlag,annDate FROM t_Anniversary WHERE annGroup<100 AND item_id=" + _sfID; SqlDataReader drStaff; DBLib dbUtil = new DBLib(); drStaff = dbUtil.MyExecuteReader(qryString); if (drStaff.Read()) { string[] arrTemp; //this.staff_id.Text = sfID; this.sLoginID.Text = drStaff["sLoginID"].ToString(); this.sLoginPW.Text = drStaff["sLoginPW"].ToString(); position.Text = PtnBaseLib.Self.GetPartnerCompany(Convert.ToInt16(Cookie.Self["position"])); this.staffNbr.Text = drStaff["staffNbr"].ToString(); this.sName.Text = drStaff["sName"].ToString(); this.DeptName.SelectedValue = drStaff["DeptName"].ToString(); this.sClass.SelectedValue = TableConfig.GetKey("Class_root", drStaff["sClass"].ToString()); this.subJobs.Text = drStaff["subJobs"].ToString(); arrTemp = drStaff["phone"].ToString().Split('-'); if (arrTemp.Length > 0) { this.phone1.Text = arrTemp[0]; this.phone2.Text = arrTemp[1]; this.phone3.Text = arrTemp[2]; arrTemp = null; } arrTemp = drStaff["cellularP"].ToString().Split('-'); if (arrTemp.Length > 0) { this.cellularP1.Text = arrTemp[0]; this.cellularP2.Text = arrTemp[1]; this.cellularP3.Text = arrTemp[2]; arrTemp = null; } this.ExtNbr.Text = drStaff["ExtNbr"].ToString(); this.sEmail.Text = drStaff["sEmail"].ToString(); arrTemp = drStaff["SSN"].ToString().Split('-'); if (arrTemp.Length > 0) { this.SSN1.Text = arrTemp[0]; this.SSN2.Text = arrTemp[1]; arrTemp = null; } this.zipcode.Text = drStaff["zipcode"].ToString(); arrTemp = drStaff["address"].ToString().Split('|'); if (arrTemp.Length > 1) { this.address1.Text = arrTemp[0]; this.address2.Text = arrTemp[1]; arrTemp = null; } this.homepage.Text = drStaff["homepage"].ToString(); this.mark.Text = drStaff["mark"].ToString(); this.sLevel.Text = drStaff["sLevel"].ToString(); //뷰스테이트로 파일 경로 저장 (체크박스 툴팁이용) //PostState.Self["sBusinessPic"] = drStaff["sBusinessPic"].ToString(); //PostState.Self["sAvataImage"] = drStaff["sAvataImage"].ToString(); //PostState.Self["sData"] = drStaff["sData"].ToString(); this.sBusinessPic.ImageUrl = SystemConfig.GetValue("StaffUploadDir") + Text.SetDefaultValue(drStaff["sBusinessPic"].ToString(), "MyPic_default.gif"); this.sBusinessPic.Style["cursor"] = "hand"; this.sBusinessPic.Attributes["OnClick"] = "javascript:ZoomWindowOpen('" + this.sBusinessPic.ImageUrl + "','bizPic','');"; //이미지 리사이즈 JinsLibrary.IMAGE.ImageLib.Self.ImageResize(ref sBusinessPic, 150, 200); this.sAvataImage.ImageUrl = @"../../zUpload/stfData/" + Text.SetDefaultValue(drStaff["sAvataImage"].ToString(), "MyPic_default.gif"); this.joinDT.Text = drStaff["joinDT"].ToString(); //파일 보존 체크박스처리 if (drStaff["sBusinessPic"].ToString() != "") { cbKeepBP.Visible = true; cbKeepBP.Checked = true; cbKeepBP.ToolTip = drStaff["sBusinessPic"].ToString(); } if (drStaff["sAvataImage"].ToString() != "") { cbKeepAI.Visible = true; cbKeepAI.Checked = true; cbKeepAI.ToolTip = drStaff["sAvataImage"].ToString(); } if (drStaff["sData"].ToString() != "") { cbKeepData.Visible = true; cbKeepData.Checked = true; cbKeepData.ToolTip = drStaff["sData"].ToString(); } //기념일 셋팅 if (drStaff.NextResult()) { string annDate; while (drStaff.Read()) { if (drStaff["annDate"].ToString() != "") { annDate = Convert.ToDateTime(drStaff["annDate"]).ToShortDateString(); } else { annDate = ""; } //Response.Write("----> " + drStaff["annDate"].ToString()); switch (Convert.ToInt32(drStaff["annGroup"])) { case 10: //생일 Util.RBLFindByValue(ref rblSLBirth, drStaff["itemFlag"].ToString()); this.tbBirthDay.Text = annDate; //Convert.ToDateTime(drStaff["annDate"]).ToShortDateString(); break; case 20: //결혼기념일 Util.RBLFindByValue(ref rblMarried, drStaff["itemFlag"].ToString()); //this.rblMarried.SelectedValue = drStaff["itemFlag"].ToString(); //되냉 if (rblMarried.SelectedValue == "미") { ClientAction.WriteJavascript(this, "pnWA", "pnWA.style.display='none';"); } else if (drStaff["annDate"].ToString() != "") { this.tbWeddingDay.Text = annDate; //Convert.ToDateTime(drCard["annDate"]).ToShortDateString(); } break; } } } //기획/관리부가 아닐때 수정못하게... if (Convert.ToInt16(Cookie.Self["sLevel"]) < 30) { this.staffNbr.Enabled = false; this.sClass.Enabled = false; this.DeptName.Enabled = false; this.joinDT.Enabled = false; this.dSelectorJoinDay.Visible = false; } drStaff.Close(); //DB닫기 dbUtil.SqlConnection.Close(); return(true); } else { return(false); } }
public string Insert(SystemConfig entity) { db.SystemConfigs.Add(entity); db.SaveChanges(); return(entity.ID); }
protected void ibUpdate_Click(object sender, ImageClickEventArgs e) { ibUpdate.Enabled = false; //데이타 충전 _ssb = new MiddleTier.Staff.StfStaffBiz(); _ssb.staff_id = Convert.ToInt16(_sfID); //공통부분/////////// CommonInsertUpdate(); ///////////////////// if (btnBusinessPic.Value != "" && cbKeepBP.Checked == false) { _ssb.sBusinessPic = "MyPic_" + _ssb.staff_id.ToString() + FileLib.Self.GetExtention(btnBusinessPic.Value); } else if (btnBusinessPic.Value == "" && cbKeepBP.Checked == false) { _ssb.sBusinessPic = ""; } else { _ssb.sBusinessPic = cbKeepBP.ToolTip; } if (btnAvataImage.Value != "" && cbKeepAI.Checked == false) { _ssb.sAvataImage = "Avata_" + _ssb.staff_id.ToString() + FileLib.Self.GetExtention(btnAvataImage.Value); } else { _ssb.sAvataImage = cbKeepAI.ToolTip; } if (btnData.Value != "" && cbKeepData.Checked == false) { _ssb.sData = "sData_" + _ssb.staff_id.ToString() + "_" + System.DateTime.Today.ToShortDateString() + FileLib.Self.GetExtention(btnData.Value); } else { _ssb.sData = cbKeepData.ToolTip; } _ssb.sLoginID = ""; //적용안됨 //파일관련 업로드 bool up_result = this.UploadFiles(); if (up_result == false) { ClientAction.ShowMsgBack("이미지파일이 아닙니다!! \\n[가능한 확장자 : " + ImageLib.Self.imagesExtsForWeb + "]"); } //DB반영 int sp_result = _ssb.Update(); if (sp_result > 0) { //직원수를 업데이트한다.(수정했어도 직원탈퇴가 있다.) StfBaseLib.Self.UpdateAllStaffNumber(); //메일보관디렉토리생성 DirectoryLib.Self.Create(SystemConfig.GetValue("MailUploadDir") + "ma_" + _ssb.staff_id + "_" + sLoginID.Text); ClientAction.ShowMsgAndGoUrl("정상적으로 수정되었습니다.", "PtnList.aspx?" + URLQuery.Self.GetQueryString()); } else { ClientAction.ShowMsgAndGoUrl("수정작업이 실패했습니다." + "Code:" + sp_result, "PtnList.aspx?" + URLQuery.Self.GetQueryString()); } }
void DoInit() { DefaultUI.SetLoadingStatusTip(DefaultUI.dataMap.Get(4).content);//数据读取中… var loadCfgSuccess = SystemConfig.Init(); if (!loadCfgSuccess) { ForwardLoadingMsgBox.Instance.ShowRetryMsgBox(DefaultUI.dataMap[53].content, (isOk) => { if (isOk) { DoInit(); } else { Application.Quit(); } }); return; } if (SystemSwitch.ReleaseMode) { //第一次导出资源 ResourceIndexInfo.Instance.Init(Application.streamingAssetsPath + "/ResourceIndexInfo.txt", () => { //如果是完整包(判断ResourceIndexInfo.txt是否存在),再判断apk的资源版本是否比本地资源版本高,如果高删除MogoResource和version.xml if (ResourceIndexInfo.Instance.Exist()) { Debug.Log("-------------------------Exist ResourceIndexInfo.txt--------------------------"); var localVer = Utils.LoadFile(SystemConfig.VersionPath); var localVersion = VersionManager.Instance.GetVersionInXML(localVer); var pkgVer = Resources.Load(SystemConfig.VERSION_URL_KEY) as TextAsset; var pkgVersion = VersionManager.Instance.GetVersionInXML(pkgVer.text); if (pkgVersion.ResouceVersionInfo.Compare(localVersion.ResouceVersionInfo) > 0) { //删除version.xml if (File.Exists(SystemConfig.VersionPath)) { File.Delete(SystemConfig.VersionPath); } //删除MogoResource文件夹 var mogoResroucesPath = SystemConfig.ResourceFolder.Substring(0, SystemConfig.ResourceFolder.Length - 1); if (Directory.Exists(mogoResroucesPath)) { Directory.Delete(mogoResroucesPath, true); } //删除后再导出version if (!File.Exists(SystemConfig.VersionPath)) { var ver = Resources.Load(SystemConfig.VERSION_URL_KEY) as TextAsset; if (ver != null) { XMLParser.SaveText(SystemConfig.VersionPath, ver.text); } } } } var go = new StreamingAssetManager(); go.AllFinished = () => { Debug.Log("firstExport finish,start checkversion"); if (SystemSwitch.UseFileSystem) { try { MogoFileSystem.Instance.Init(); } catch (Exception ex) { Debug.LogException(ex); } } VersionManager.Instance.Init(); VersionManager.Instance.LoadLocalVersion(); CheckVersion(CheckVersionFinish); }; go.FirstExport(); }); } else { SystemConfig.LoadServerList(); VersionManager.Instance.Init(); VersionManager.Instance.LoadLocalVersion(); //UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(gameObject, "Assets/Plugins/Init/Driver.cs (187,13)", "MogoInitialize"); //if (ass.GetType("MogoInitialize") != null) //gameObject.AddComponent(ass.GetType("MogoInitialize")); var t = System.Type.GetType("MogoInitialize,Assembly-CSharp"); var addedComponent = gameObject.AddComponent(t); IsRunOnAndroid = false; gameObject.AddComponent <PlatformSdkManager>(); } }
public PoolSystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig) { _viewsBuffer = new Dictionary <Type, HashSet <GameView> >(); }
/// <summary> /// Gets the system rules /// </summary> /// <returns></returns> public static bool SetRules() { SystemRules = SetRules(true); return(true); }
public void UpdateParamatricBusinessRules_ParamatricBusinessRulesModelDto_MaximumLeadTime() { var settingsMock = new Mock<ISettings>(); var repositoryMock = new Mock<IRepository>(); var uowMock = new Mock<IUnitOfWork>(); var serviceLocatorMock = new Mock<IServiceLocator>(); serviceLocatorMock.Setup(x => x.GetInstance<IRepository>()) .Returns(repositoryMock.Object); serviceLocatorMock.Setup(x => x.GetInstance<IUnitOfWork>()) .Returns(uowMock.Object); ServiceLocator.SetLocatorProvider(() => serviceLocatorMock.Object); repositoryMock.Setup(r => r.CreateUnitOfWork()).Returns(uowMock.Object); // Arrange Guid id = Guid.NewGuid(); ParamatricBusinessRulesModelDto paramatricBusinessRulesModelDto = new ParamatricBusinessRulesModelDto { CommissionLevels = "COMMISSION_LEVELS", ExpiryTimeFrame = "ExpiryTimeFrame".ToUpper(), FileUploadLimits = "FileUploadLimits".ToUpper(), Margins = "Margins".ToUpper(), MaximumBooking = "MaximumBooking".ToUpper(), MaximumLeadTime = "MAXIMUM_LEAD_TIME", MinimumBooking = "MinimumBooking".ToUpper(), MinimumLeadTime = "MinimumLeadTime".ToUpper(), NavigateHref = "NavigateHref".ToUpper() }; SystemConfig config = new SystemConfig { Id = Guid.NewGuid(), Name = "MAXIMUM_LEAD_TIME" }; SystemConfig[] systemConfigs = new SystemConfig[] { config }; repositoryMock.Setup(r => r.Query<SystemConfig>()).Returns(systemConfigs.AsQueryable()); // Act ManagementService managementService = new ManagementService( uowMock.Object, repositoryMock.Object, settingsMock.Object); managementService .UpdateParamatricBusinessRules(paramatricBusinessRulesModelDto); // Assert //Query repositoryMock.Verify(repo => repo.Query<SystemConfig>()); //Update repositoryMock.Verify(repo => repo.Update<SystemConfig>(It.Is<SystemConfig> (s => s.Name == ParamatricBusinessRules.MAXIMUM_LEAD_TIME.ToString()))); //Insert repositoryMock.Verify(repo => repo.Insert<SystemConfig>(It.Is<SystemConfig> (s => s.Name == ParamatricBusinessRules.EXPIRY_TIMEFRAME.ToString()))); repositoryMock.Verify(repo => repo.Insert<SystemConfig>(It.Is<SystemConfig> (s => s.Name == ParamatricBusinessRules.FILE_UPLOAD_LIMITS.ToString()))); repositoryMock.Verify(repo => repo.Insert<SystemConfig>(It.Is<SystemConfig> (s => s.Name == ParamatricBusinessRules.MAXIMUM_BOOKING.ToString()))); repositoryMock.Verify(repo => repo.Insert<SystemConfig>(It.Is<SystemConfig> (s => s.Name == ParamatricBusinessRules.COMMISSION_LEVELS.ToString()))); repositoryMock.Verify(repo => repo.Insert<SystemConfig>(It.Is<SystemConfig> (s => s.Name == ParamatricBusinessRules.MINIMUM_BOOKING.ToString()))); repositoryMock.Verify(repo => repo.Insert<SystemConfig>(It.Is<SystemConfig> (s => s.Name == ParamatricBusinessRules.MINIMUM_LEAD_TIME.ToString()))); //Save uowMock.Verify(uow => uow.Save()); }
private string message(Guid ActivationKey, User _user) { string strMsgContent = string.Empty; try { string name = _user.FirstName + " " + _user.MiddleName + " " + _user.LastName; string RegisterUrl = SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + "Student/Student_Profile_Add.aspx?ActivationKey=" + ActivationKey; strMsgContent = "<div style=\"border:solid 1px #efefef;\"><div style=\"width:800;border:solid " + "1px #efefef;font-weight:bold; font-family:Verdana;font-size:12px; text-align:left;" + " background-color:#efefef;\" > <strong>Dear</strong> <span >" + name + ", " + "</span></div>" + "<br />"; string loginpath = SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + "Login.aspx?type=s"; strMsgContent = strMsgContent + "One of your house Room-mate created account with" + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + ", and Request you to join with " + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + ",<br/><br/>"; //strMsgContent = strMsgContent + "Your account details are as follows. <br/><br/>"; //strMsgContent = strMsgContent + "Your Name: " + name + " <br/>"; //strMsgContent = strMsgContent + "Email : " + _user.PersonalEmail + " <br/>"; //strMsgContent = strMsgContent + "Contact No : " + _user.BestContactNumber + " <br/>"; //strMsgContent = strMsgContent + "Please keep these details safe for future use.<br/>"; strMsgContent = strMsgContent + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + " is a fast growing online house rating system that support for property owener's and students to connecting with each others.<br/><br/>"; strMsgContent = strMsgContent + "'<b>Student housing made simple, reliable, most of all accountable..</b>' <br/><br/>"; strMsgContent = strMsgContent + "if your are happy to join with us, Please click on the link below to create your account. it's 100% free.<br/><br/>"; strMsgContent = strMsgContent + "<a href=" + RegisterUrl + "> Create Your " + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + " Account </a> <br/><br/>"; strMsgContent = strMsgContent + "If you have any issues with creating your account, please email " + "<a href=\"mailto:" + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SMTP_FROM_EMAIL) + "?subject=I have issue with creating my account\"> " + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SMTP_FROM_EMAIL) + " </a><br/>"; strMsgContent = strMsgContent + "If you have already Registred, " + "<a href=" + loginpath + "> click here </a> to login to " + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + ". <br/>"; strMsgContent = strMsgContent + "<br /> <strong>This is an automated response to activate your account. Please do not reply to this email.<br /><br />"; strMsgContent = strMsgContent + "Sincerely yours,<br /> <a href=\"" + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + "\">" + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + "</a></strong><br /><br /></div>"; strMsgContent = strMsgContent + "</br><span style=\"color:#818181; font-style:italic; font-size:12px;\">This email is confidential and is intended only for the individual named. Although reasonable precautions have been taken to ensure no viruses are present in this email, " + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + " do not warrant that this e-mail is free from viruses or other corruptions and is not liable to the recipient or any other party should any virus or other corruption be present in this e-mail. If you have received this email in error please notify the sender.</span>"; } catch (Exception ex) { strMsgContent = string.Empty; } return(strMsgContent); }
public void Update(SystemConfig systemConfig) { _systemConfigRepository.Update(systemConfig); }
public bool Delete(SystemConfig entity) { throw new NotImplementedException(); }
private void SetupOptions(ScreenResolution resolution) { RegistryKey regKeyc = Registry.CurrentUser.OpenSubKey(@"Software", true); if (regKeyc != null) { regKeyc = regKeyc.CreateSubKey("Future Pinball").CreateSubKey("GamePlayer"); } if (regKeyc != null) { regKeyc.SetValue("FullScreen", 1); //regKeyc.SetValue("FullScreen", 0); if (SystemConfig.isOptSet("arcademode") && SystemConfig["arcademode"] == "1") { regKeyc.SetValue("ArcadeMode", 1); } else { regKeyc.SetValue("ArcadeMode", 0); } if (SystemConfig.isOptSet("ratio")) { if (SystemConfig["ratio"] == "4/3") { regKeyc.SetValue("AspectRatio", 43); } else if (SystemConfig["ratio"] == "16/9") { regKeyc.SetValue("AspectRatio", 169); } } else { regKeyc.SetValue("AspectRatio", 169); } if (resolution != null) { regKeyc.SetValue("Width", resolution.Width); regKeyc.SetValue("Height", resolution.Height); regKeyc.SetValue("BitsPerPixel", resolution.BitsPerPel); } else { regKeyc.SetValue("Height", Screen.PrimaryScreen.Bounds.Height); regKeyc.SetValue("Width", Screen.PrimaryScreen.Bounds.Width); regKeyc.SetValue("BitsPerPixel", Screen.PrimaryScreen.BitsPerPixel); } if (regKeyc.GetValue("DefaultCamera") == null) { regKeyc.SetValue("DefaultCamera", 0); } if (regKeyc.GetValue("CameraFollowsTheBall") == null) { regKeyc.SetValue("CameraFollowsTheBall", 0); } if (SystemConfig.isOptSet("preset") && SystemConfig["preset"] == "medium") { regKeyc.SetValue("RenderGameRoom", 1); regKeyc.SetValue("RenderOrnaments", 1); regKeyc.SetValue("GlassOverlay", 1); regKeyc.SetValue("LightFacets", 0x20); regKeyc.SetValue("GlassReflections", 0); regKeyc.SetValue("PlayfieldReflections", 1); regKeyc.SetValue("RenderBallMirrors", 0); regKeyc.SetValue("SuperNiceCrystal", 0); regKeyc.SetValue("HighQualityPinballs", 1); regKeyc.SetValue("BallDirt", 1); regKeyc.SetValue("DisableShaders", 0); regKeyc.SetValue("ModelRenderQuality", 1); regKeyc.SetValue("RubberFacets", 0x10); regKeyc.SetValue("RubberSides", 0x0c); regKeyc.SetValue("WireGuideSides", 0x0c); regKeyc.SetValue("HighQualityTextures", 1); } else if (SystemConfig.isOptSet("preset") && SystemConfig["preset"] == "min") { regKeyc.SetValue("RenderGameRoom", 0); regKeyc.SetValue("RenderOrnaments", 0); regKeyc.SetValue("GlassOverlay", 0); regKeyc.SetValue("LightFacets", 0x10); regKeyc.SetValue("GlassReflections", 0); regKeyc.SetValue("PlayfieldReflections", 0); regKeyc.SetValue("RenderBallMirrors", 0); regKeyc.SetValue("SuperNiceCrystal", 0); regKeyc.SetValue("HighQualityPinballs", 0); regKeyc.SetValue("BallDirt", 0); regKeyc.SetValue("DisableShaders", 1); regKeyc.SetValue("ModelRenderQuality", 0); regKeyc.SetValue("RubberFacets", 0x08); regKeyc.SetValue("RubberSides", 0x06); regKeyc.SetValue("WireGuideSides", 0x06); regKeyc.SetValue("HighQualityTextures", 0); } else { regKeyc.SetValue("RenderGameRoom", 1); regKeyc.SetValue("RenderOrnaments", 1); regKeyc.SetValue("GlassOverlay", 1); regKeyc.SetValue("LightFacets", 0x40); regKeyc.SetValue("GlassReflections", 1); regKeyc.SetValue("PlayfieldReflections", 1); regKeyc.SetValue("RenderBallMirrors", 1); regKeyc.SetValue("SuperNiceCrystal", 1); regKeyc.SetValue("HighQualityPinballs", 1); regKeyc.SetValue("BallDirt", 1); regKeyc.SetValue("DisableShaders", 0); regKeyc.SetValue("ModelRenderQuality", 2); regKeyc.SetValue("RubberFacets", 0x40); regKeyc.SetValue("RubberSides", 0x14); regKeyc.SetValue("WireGuideSides", 0x14); regKeyc.SetValue("HighQualityTextures", 1); } regKeyc.Close(); } regKeyc = Registry.CurrentUser.OpenSubKey(@"Software", true); if (regKeyc != null) { regKeyc = regKeyc.CreateSubKey("Future Pinball").CreateSubKey("Editor"); } if (regKeyc != null) { regKeyc.SetValue("LoadImagesIntoEditor", 0); regKeyc.Close(); } }
public SystemConfig Add(SystemConfig newConfig) { return(RepositoryBase <SystemConfig> .Add(newConfig)); }
/// <summary> /// Get the System configuration. /// </summary> /// <param name="value">Value to get the configuration.</param> /// <returns>The system configuration.</returns> private SystemConfig GetSystemConfig(byte value) { SystemConfig sysCfg = new SystemConfig(); sysCfg.VelTransform = GetTransform(value); sysCfg.IsTiltUsed = GetTilt(value); sysCfg.Is3BeamSolution = Get3BeamSolution(value); sysCfg.Frequency = GetFreq(value); return sysCfg; }
public void Update(SystemConfig newConfig) { RepositoryBase <SystemConfig> .Update(newConfig); }
public void SetUp() { this.util = RandomUtilFactory.Make(); this.sysConfig = new SystemConfig(); this.sysConfig.Basepath = "../../../Resources"; }
public AnimationSystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig) { }
public void Store(SystemConfig config) { JsonFile.Write(_configFile, config); }
public CrawlerCore(SystemConfig sc) : base(sc) { this.SearchWords = sc.SrchKeyWords; }