private void Login() { try { UserModel result = _api.LoginUser(User.Phone); if (result == null) { throw new Exception("User Not Found"); } else if (User.Password == result.Password)//SecurePasswordHasherHelper.Verify(User.Password, result.Password)) { //set session data //go to dashboard _ = new AllBankAccounts(); _ = new AllTransactions(); result = setAccounts.SetBankAccounts(result); _ = new CreateData(result); Mediator.Notify(ApplicationPage.Dashboard.ToString(), ""); } else { //login failed MessageBox.Show("login failed"); } } catch (Exception) { MessageBox.Show("User Not Found"); } }
public static void CreateHeroData() { var createData = new CreateData(); createData.CreateCostumeMaster(); createData.CreateHairMaster(); }
public void SmartContracts_GasInjector_MultipleParamConstructorGasInjectedSuccess() { SmartContractCompilationResult compilationResult = SmartContractCompiler.Compile(TestMultipleConstructorSource); Assert.True(compilationResult.Success); byte[] originalAssemblyBytes = compilationResult.Compilation; var gasLimit = (Gas)500000; var gasMeter = new GasMeter(gasLimit); var internalTxExecutorFactory = new InternalTransactionExecutorFactory(this.keyEncodingStrategy, this.loggerFactory, this.network); var vm = new ReflectionVirtualMachine(this.validator, internalTxExecutorFactory, this.loggerFactory, this.network, this.addressGenerator); var callData = new CreateData(gasLimit, originalAssemblyBytes, new[] { "Test Owner" }); var transactionContext = new TransactionContext( txHash: uint256.One, blockHeight: 0, coinbase: TestAddress.ToUint160(this.network), sender: TestAddress.ToUint160(this.network), amount: 0 ); VmExecutionResult result = vm.Create(gasMeter, this.repository, callData, transactionContext); // Constructor: 15 // Property setter: 12 // Storage: 150 Assert.Equal((Gas)177, result.GasConsumed); }
public override void Write() { Packet.Write(NumObjUpdates); Packet.Write(MapId); Packet.PutBit(DestroyOrOutOfRange); Packet.FlushBits(); if (DestroyOrOutOfRange) { DestroyData.Write(Packet); } Packet.Write(0); if (NumObjUpdates > 0) { // UpdateType 1 (CreateObject) Packet.Write <byte>(1); Packet.Write(Obj.Guid); Packet.Write <byte>(4); CreateData.Write(Packet); // Descriptors. Obj.WriteToPacket(Packet); // Write data length to packet. Packet.Write(Packet.Written - 15, 11); } }
public void SmartContracts_GasInjector_SingleParamConstructorGasInjectedSuccess() { SmartContractCompilationResult compilationResult = SmartContractCompiler.Compile(TestSingleConstructorSource); Assert.True(compilationResult.Success); byte[] originalAssemblyBytes = compilationResult.Compilation; var gasLimit = (Gas)500000; var gasMeter = new GasMeter(gasLimit); var callData = new CreateData(gasLimit, originalAssemblyBytes); var transactionContext = new TransactionContext( txHash: uint256.One, blockHeight: 0, coinbase: TestAddress.ToUint160(this.network), sender: TestAddress.ToUint160(this.network), amount: 0 ); VmExecutionResult result = this.vm.Create(gasMeter, this.repository, callData, transactionContext); // TODO: Un-hard-code this. // Constructor: 15 // Property setter: 12 // Storage: 150 Assert.Equal((Gas)177, result.GasConsumed); }
static void CreateObject() { CreateData data = CreateInstance <CreateData>(); string path = AssetDatabase.GenerateUniqueAssetPath("Assets/Resources/Data_" + Application.unityVersion + ".asset"); AssetDatabase.CreateAsset(data, path); AssetDatabase.Refresh(); }
public void LoginError() { session.BeginTransaction(); CreateData.CreateOutsider(session, new web_app.Models.Outsider() { Login = "******" + new Random().Next(100, 999), Name = "name_" + new Random().Next(100, 999), Enabled = false }); var item = session.Query <web_app.Models.Outsider>().OrderByDescending(s => s.Id).FirstOrDefault(); var blockNameNew = "#loginForm "; string login = item.Login; string password = ConfigurationManager.AppSettings["DefaultOperatorPassword"]; Open("Account/Login"); //login if (browser.FindElementsByCssSelector(blockNameNew + "input[id='UserName']").Count == 0) { throw new Exception(browser.FindElementByCssSelector("body").Text); } var inputObj = browser.FindElementByCssSelector(blockNameNew + "input[id='UserName']"); inputObj.Clear(); inputObj.SendKeys(login); //password inputObj = browser.FindElementByCssSelector(blockNameNew + "input[id='Password']"); inputObj.Clear(); inputObj.SendKeys(password); browser.FindElementByCssSelector(blockNameNew + "input[type='submit']").Click(); AssertText("Учетные данные введены неверно!"); password = "******"; //login inputObj = browser.FindElementByCssSelector(blockNameNew + "input[id='UserName']"); inputObj.Clear(); inputObj.SendKeys(login); //password inputObj = browser.FindElementByCssSelector(blockNameNew + "input[id='Password']"); inputObj.Clear(); inputObj.SendKeys(password); browser.FindElementByCssSelector(blockNameNew + "input[type='submit']").Click(); AssertText("Учетные данные введены неверно!"); // login = "******"; password = "******"; //login inputObj = browser.FindElementByCssSelector(blockNameNew + "input[id='UserName']"); inputObj.Clear(); inputObj.SendKeys(login); //password inputObj = browser.FindElementByCssSelector(blockNameNew + "input[id='Password']"); inputObj.Clear(); inputObj.SendKeys(password); browser.FindElementByCssSelector(blockNameNew + "input[type='submit']").Click(); AssertText("Минимальная длина имени пользователя"); AssertText("Минимальная длина пароля"); }
private void StopELI_Click(object sender, RoutedEventArgs e) { lock (OPCObjects.OPCLocker) { OPCObjects.StopProcessSignal.Value = true; OPCUAWorker.OPCUAWorker.Write <bool>(OPCObjects.StopProcessSignal.Path, OPCObjects.StopProcessSignal.Value); } CreateData.AddOperatoAction(OPCObjects.user.Login, "Ручная остановка напыления"); }
private void OpenCam_Click(object sender, RoutedEventArgs e) { lock (OPCObjects.OPCLocker) { OPCObjects.Tech_cam_STAGE.Value = 3; OPCUAWorker.OPCUAWorker.Write <int>(OPCObjects.Tech_cam_STAGE.Path, OPCObjects.Tech_cam_STAGE.Value); } CreateData.AddOperatoAction(OPCObjects.user.Login, "Запуск автоматического напуска камеры"); }
private void PreHeatProc_Click(object sender, RoutedEventArgs e) { lock (OPCObjects.OPCLocker) { OPCObjects.PreHeat_Start.Value = true; OPCUAWorker.OPCUAWorker.Write <bool>(OPCObjects.PreHeat_Start.Path, OPCObjects.PreHeat_Start.Value); } CreateData.AddOperatoAction(OPCObjects.user.Login, "Включение режима препрогрева"); }
private void Button_Click_1(object sender, RoutedEventArgs e) { lock (OPCObjects.OPCLocker) { OPCObjects.Tech_cam_STAGE.Value = 5; OPCUAWorker.OPCUAWorker.Write <int>(OPCObjects.Tech_cam_STAGE.Path, OPCObjects.Tech_cam_STAGE.Value); } CreateData.AddOperatoAction(OPCObjects.user.Login, "Запуск автоматической остановки ФВН"); }
private CreateData CreateDataCallback() { m_CreateData = new CreateData(); m_CreateData.playerName = PlayerName.text; m_CreateData.characterOneName = CharacterOneName.text; m_CreateData.characterTwoName = CharacterTwoName.text; m_CreateData.characterThreeName = CharacterThreeName.text; m_CreateData.rocaOneType = RocaOneType.captionText.text; m_CreateData.rocaTwoType = RocaTwoType.captionText.text; m_CreateData.rocaThreeType = RocaThreeType.captionText.text; return(m_CreateData); }
/// <summary> /// This method allows you to prepare transaction for customer. /// </summary> /// <param name="model">Provides data required to create transaction</param> /// <returns>Response from api mapped to c# object. Includes data required to execute other methods</returns> public async Task <CreateResponse> CreateTransaction(CreateData model) { #region hashing //Hash is required for seurity reason. "md5sum" is mandatory. "timeHash" will be set if date will be set. var hashCalculator = new HashCalculator(); var md5Sum = hashCalculator.Md5Sum(_credentials.Id.ToString(), model.Amount.ToString("0.00").Replace(",", "."), _credentials.CRC, _credentials.Code); string timeHash = null; if (model.ExpirationDate != null) { timeHash = hashCalculator.TimeHash(model.ExpirationDate.Value.ToString(DateTimeFormat), _credentials.Code); } #endregion var secrets = new Secrets { Md5sum = md5Sum, TimeHash = timeHash, CRC = _credentials.CRC, Id = _credentials.Id, Password = _credentials.Password }; return(await _api.Create(new Create { Id = secrets.Id, CRC = secrets.CRC, TimeHash = secrets.TimeHash, Md5sum = secrets.Md5sum, ApiPassword = secrets.Password, AcceptTos = model.AcceptTos, Address = model.Address, Amount = model.Amount.ToString("0.00").Replace(",", "."), City = model.City, Country = model.Country, CustomDescription = model.CustomDescription, Description = model.Description, Email = model.Email, ExprationDate = model.ExpirationDate != null ? model.ExpirationDate.Value.ToString(DateTimeFormat) : null, Group = model.Group, Language = model.Language, MerchantDescription = model.MerchantDescription, Name = model.Name, Online = model.Online, Phone = model.Phone, ResultEmail = model.ResultEmail, ResultUrl = model.ResultUrl, ReturnErrorUrl = model.ReturnErrorUrl, ReturnUrl = model.ReturnUrl, Zip = model.Zip, })); }
public bool Equals(CreateData x, CreateData y) { return(x.ClientVisitId == y.ClientVisitId && x.ErrorMessage == y.ErrorMessage && x.ExpirationDate == y.ExpirationDate && x.FundAnswer == y.FundAnswer && x.OGRN == y.OGRN && x.OKATO == y.OKATO && x.PolicyNumber == y.PolicyNumber && x.PolicySeries == y.PolicySeries && x.PolicyTypeId == y.PolicyTypeId && x.StartDate == y.StartDate && x.UnifiedPolicyNumber == y.UnifiedPolicyNumber); }
public void VM_CreateContract_WithParameters() { //Get the contract execution code------------------------ SmartContractCompilationResult compilationResult = SmartContractCompiler.CompileFile("SmartContracts/Auction.cs"); Assert.True(compilationResult.Success); byte[] contractExecutionCode = compilationResult.Compilation; //------------------------------------------------------- //Set the calldata for the transaction---------- var methodParameters = new object[] { (ulong)5 }; var callData = new CreateData((Gas)5000000, contractExecutionCode, methodParameters); Money value = Money.Zero; //------------------------------------------------------- var repository = new ContractStateRepositoryRoot(new NoDeleteSource <byte[], byte[]>(new MemoryDictionarySource())); IContractStateRepository track = repository.StartTracking(); var gasMeter = new GasMeter(callData.GasLimit); var internalTxExecutorFactory = new InternalTransactionExecutorFactory(this.keyEncodingStrategy, this.loggerFactory, this.network); var vm = new ReflectionVirtualMachine(this.validator, internalTxExecutorFactory, this.loggerFactory, this.network, this.addressGenerator); var transactionContext = new TransactionContext( txHash: uint256.One, blockHeight: 1, coinbase: TestAddress.ToUint160(this.network), sender: TestAddress.ToUint160(this.network), amount: value ); VmExecutionResult result = vm.Create(gasMeter, repository, callData, transactionContext); track.Commit(); var endBlockValue = track.GetStorageValue(result.NewContractAddress, Encoding.UTF8.GetBytes("EndBlock")); Assert.Equal(6, BitConverter.ToInt16(endBlockValue, 0)); Assert.Equal(TestAddress.ToUint160(this.network).ToBytes(), track.GetStorageValue(result.NewContractAddress, Encoding.UTF8.GetBytes("Owner"))); }
private void CrioStart_Click(object sender, RoutedEventArgs e) { if (OPCObjects.user.Role == 0) { MessageBox.Show("Не хвататет прав доступа"); } else { lock (OPCObjects.OPCLocker) { OPCObjects.Crio_start_signal.Value = true; OPCUAWorker.OPCUAWorker.Write <bool>(OPCObjects.Crio_start_signal.Path, OPCObjects.Crio_start_signal.Value); } CreateData.AddOperatoAction(OPCObjects.user.Login, "Запуск автоматического включения крионасоса"); } }
public int GetHashCode(CreateData obj) { return (obj.ClientVisitId.GetHashCode() ^ (obj.DataTypeId ?? 0).GetHashCode() ^ (obj.ErrorMessage ?? string.Empty).GetHashCode() ^ (obj.ExpirationDate ?? default(DateTime)).GetHashCode() ^ (obj.FundAnswer ?? string.Empty).GetHashCode() ^ (obj.OGRN ?? string.Empty).GetHashCode() ^ (obj.OKATO ?? string.Empty).GetHashCode() ^ (obj.PolicyNumber ?? string.Empty).GetHashCode() ^ (obj.PolicySeries ?? string.Empty).GetHashCode() ^ (obj.PolicyTypeId ?? 0).GetHashCode() ^ (obj.StartDate ?? default(DateTime)).GetHashCode() ^ (obj.UnifiedPolicyNumber ?? string.Empty).GetHashCode()); }
public void RegisterUsers() { var newOutsider = CreateData.CreateOutsider(session, dontSave: true); string password = ConfigurationManager.AppSettings["DefaultOperatorPassword"]; var outsider = session.Query <web_app.Models.Outsider>().OrderByDescending(s => s.Id).FirstOrDefault(); var blockNameNew = ".container.body-content "; LoginAsAdmin(); browser.FindElementByCssSelector("a[id='LinkUserList']").Click(); WaitForVisibleCss("table"); AssertText(outsider.Name); browser.FindElementByCssSelector(".panel .btn.btn-success").Click(); WaitForVisibleCss("[id='UserName']"); //UserName var inputObj = browser.FindElementByCssSelector(blockNameNew + "input[id='UserName']"); inputObj.Clear(); inputObj.SendKeys(newOutsider.Name); //Login inputObj = browser.FindElementByCssSelector(blockNameNew + "input[id='Login']"); inputObj.Clear(); inputObj.SendKeys(newOutsider.Login); //Password inputObj = browser.FindElementByCssSelector(blockNameNew + "input[id='Password']"); inputObj.Clear(); inputObj.SendKeys(password); browser.FindElementByCssSelector(blockNameNew + "input[name='Enabled']").Click(); browser.FindElementByCssSelector(blockNameNew + "input[type='submit']").Click(); WaitForVisibleCss("table"); AssertText(newOutsider.Name); newOutsider = session.Query <web_app.Models.Outsider>().FirstOrDefault(s => s.Login == newOutsider.Login); browser.FindElementByCssSelector(blockNameNew + @"a[href*='/" + newOutsider.Id + "']").Click(); WaitForVisibleCss("[id='UserName']"); //UserName inputObj = browser.FindElementByCssSelector(blockNameNew + "input[id='UserName']"); inputObj.Clear(); inputObj.SendKeys("new" + newOutsider.Name); //Login inputObj = browser.FindElementByCssSelector(blockNameNew + "input[id='Login']"); inputObj.Clear(); inputObj.SendKeys("new" + newOutsider.Login); browser.FindElementByCssSelector(blockNameNew + "input[type='submit']").Click(); session.Refresh(newOutsider); WaitForVisibleCss("table"); AssertText(newOutsider.Name); }
public void Create(Path path = null, bool overwrite = false) { var recordInfo = this.RecordInfo; var fileSpec = recordInfo.GetCreateFileSpec(); var keySpecs = recordInfo.Keys.SelectMany(k => k.Segments.Select(s => s.GetCreateKeySpec())); var createData = new CreateData(fileSpec, keySpecs); var filePath = Path.Merge(path, this.Path).GetFilePath(); _nativeOperator.Create(filePath, createData, overwrite); if (recordInfo.OwnerName != null) { var positionBlock = _nativeOperator.Open(filePath); try { _nativeOperator.SetOwner(positionBlock, recordInfo.OwnerName, recordInfo.OwnerNameOption); } finally { _nativeOperator.Close(positionBlock); } } }
public void DeleteObject(Vector3Int pos, int nextData, int objectId, CreateData createData) { MapObject mobj = GetMapObj(pos, objectId); mapObjects.Remove(mobj); Destroy(mobj.go); stageData[pos.x][pos.y][pos.z] = nextData; if (createData == CreateData.noCreate) { return; } //下にブロックを置くもの SpecialObject Special = new SpecialObject(); Vector3 position = Utility.DataToPosition(new Vector3Int(pos.x, pos.y, pos.z)); stageCreateTask.CreateObject(position, nextData, 0, Special, mapObjects, drawFloorTask.floorObjects[pos.x], createData == CreateData.groundCreate); }
static void Main() { #region 初始化PLC try { System.Threading.Thread.Sleep(300); Dictionary <string, List <string> > typeClass = new Dictionary <string, List <string> >(); DataTable table = RfConfig.Create().plcds.Tables[0]; foreach (DataRow row in table.Rows) { string[] plcstr = row["plcvalaue"].ToString().Split('%'); List <string> listPlc = new List <string>(); for (int i = 0; i < plcstr.Length; i++) { if (plcstr[i].ToString().Trim().Length > 0) { listPlc.Add(plcstr[i].ToString()); } } typeClass.Add(row["vlaue"].ToString(), listPlc); } PlcFactory.Instance().typeClass = typeClass; } catch (Exception ex) { // SystemParam.ErrText = ex.Message.ToString(); DevExpress.XtraSplashScreen.SplashScreenManager.Default.SendCommand( SplashScreen1.SplashScreenCommand.labelControl2, "初始化PLC失败"); // SystemParam.plcStatus = false; } #endregion CreateData.createDataBase(); Application.Run(new FrmMain()); }
CreateData Create(Sprite sprite) { var instance = new GameObject(); instance.name = data.fileName + "_" + sprite.name; instance.transform.SetParent(data.parentTrasform); var rectTrans = instance.AddComponent <RectTransform>(); rectTrans.localScale = Vector3.one; rectTrans.sizeDelta = data.parentTrasform.GetComponent <RectTransform>().sizeDelta; rectTrans.localRotation = Quaternion.identity; var image = instance.AddComponent <Image>(); image.sprite = sprite; image.color = data.color; var createData = new CreateData() { rectTrans = rectTrans, image = image }; return(createData); }
public IHttpActionResult CreateResource(CreateData input) { return(Ok()); }
public static void Main(string[] args) { //args = new string[] { "CBADONGTIEN1" }; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(defaultValue: false); BonusSkins.Register(); OfficeSkins.Register(); string defaultStyle2 = "Money Twins"; DefaultLookAndFeel defaultLookAndFeelMain2 = new DefaultLookAndFeel(); if (defaultStyle2 != string.Empty) { defaultLookAndFeelMain2.LookAndFeel.SetSkinStyle(defaultStyle2); } string H_KEY = "HKEY_CURRENT_USER\\Software\\SGD\\"; RegistryKey HKey = Registry.CurrentUser.OpenSubKey("Software\\SGD\\"); if (HKey == null) { Registry.CurrentUser.CreateSubKey("Software\\SGD\\"); HKey = Registry.CurrentUser.OpenSubKey("Software\\SGD\\"); } string server = ConfigurationSettings.AppSettings["WebServer"]; Config.NewKeyValue("WebServer", server); string productName3 = "CBABPM"; string[] softList = HKey.GetSubKeyNames(); string P_KEY2 = ""; if (args.Length != 0) { productName3 = args[0]; softList = new[] { args[0] }; } if (softList.Length > 1) { fSoftList fsl = new fSoftList(); fsl.ShowDialog(); productName3 = fsl.Productname; P_KEY2 = H_KEY + productName3 + "\\"; if (productName3 == string.Empty) { return; } } else if (softList.Length == 0) { //productName3 = "CBASGD133"; string subkey = "Software\\SGD\\" + productName3; P_KEY2 = H_KEY + productName3 + "\\"; RegistryKey pKey = Registry.CurrentUser.OpenSubKey(subkey); if (pKey == null) { Registry.CurrentUser.CreateSubKey(subkey); Registry.SetValue(P_KEY2, "CompanyName", "SGD", RegistryValueKind.String); Registry.SetValue(P_KEY2, "Created", "0", RegistryValueKind.DWord); Registry.SetValue(P_KEY2, "isDemo", "0", RegistryValueKind.DWord); Registry.SetValue(P_KEY2, "Language", "0", RegistryValueKind.DWord); Registry.SetValue(P_KEY2, "Package", "7", RegistryValueKind.String); Registry.SetValue(P_KEY2, "isOnline", "0", RegistryValueKind.DWord); Registry.SetValue(P_KEY2, "Password", "20-2C-B9-62-AC-59-07-5B-96-4B-07-15-2D-23-4B-70", RegistryValueKind.ExpandString); Registry.SetValue(P_KEY2, "RegisterNumber", "", RegistryValueKind.String); Registry.SetValue(P_KEY2, "SavePassword", "True", RegistryValueKind.String); Registry.SetValue(P_KEY2, "StructDb", "SGD", RegistryValueKind.String); Registry.SetValue(P_KEY2, "RemoteServer", "SGD", RegistryValueKind.String); Registry.SetValue(P_KEY2, "Style", "Money Twins", RegistryValueKind.String); Registry.SetValue(P_KEY2, "SupportOnline", "SGD", RegistryValueKind.String); Registry.SetValue(P_KEY2, "UserName", "Admin", RegistryValueKind.String); Registry.SetValue(P_KEY2, "isRemote", "False", RegistryValueKind.String); Registry.SetValue(P_KEY2, "SoftType", "0", RegistryValueKind.DWord); } } else { productName3 = softList[0]; P_KEY2 = H_KEY + productName3 + "\\"; } Config.NewKeyValue("ProductName", productName3); Config.NewKeyValue("H_KEY", P_KEY2); defaultStyle2 = Registry.GetValue(P_KEY2, "Style", string.Empty).ToString(); defaultLookAndFeelMain2 = new DefaultLookAndFeel(); if (defaultStyle2 != string.Empty) { defaultLookAndFeelMain2.LookAndFeel.SetSkinStyle(defaultStyle2); } string created = Registry.GetValue(P_KEY2, "Created", 0).ToString(); if (created == "0") { CreateData frmCreateData = new CreateData(productName3); frmCreateData.ShowDialog(); if (frmCreateData.DialogResult == DialogResult.Cancel) { return; } Registry.SetValue(P_KEY2, "Created", 1); } Config.NewKeyValue("H_KEY", P_KEY2); int SoftType = (int)Registry.GetValue(P_KEY2, "SoftType", 1); int isOnline = 0; try { isOnline = (int)Registry.GetValue(P_KEY2, "isOnline", 0); } catch { } string extend = isOnline == 0 ? "" : "1"; string Company = Registry.GetValue(P_KEY2, "CompanyName", "").ToString(); CPUid Cpu = (SoftType != 0) ? new CPUid(Company + productName3 + "SGDBPMOnline" + extend) : new CPUid(Company + productName3 + "SGDEMTOnline" + extend); string RegisterNumber = Registry.GetValue(P_KEY2, "RegisterNumber", "").ToString(); if (RegisterNumber != Cpu.KeyString) { Config.NewKeyValue("isDemo", 1); if (MessageBox.Show("Bạn đang dùng phiên bản demo, bạn có muốn đăng ký lại không?", "Thông báo", MessageBoxButtons.YesNo) == DialogResult.Yes) { RegisterF rf = new RegisterF(); rf.producName = productName3; rf.ShowDialog(); Config.NewKeyValue("isDemo", 0); if (rf.DialogResult == DialogResult.Cancel) { return; } RegisterNumber = rf.textEditValue.Text; } } else { Config.NewKeyValue("isDemo", 0); Config.NewKeyValue("CompanyName", Company); Config.NewKeyValue("SoftType", SoftType); Config.NewKeyValue("isOnline", isOnline); } SetEnvironment(); //Check data online phải có register trên server Login frmLogin = new Login(); frmLogin.ShowDialog(); if (frmLogin.DialogResult != DialogResult.Cancel) { if (isOnline == 1)//Kiểm tra ngày hết hạn { try { CDTControl.Log log = new CDTControl.Log(); string uKey = log.GetExDate(RegisterNumber); UserKey key = JsonConvert.DeserializeObject <UserKey>(uKey); if (key == null) { if (File.Exists(productName3 + ".txt")) { MessageBox.Show("Máy bạn đã hết hạn sử dụng gói phần mềm này! \n Liên hệ : 0935.45.75.15 Vỹ Công Trần để được hướng dẫn"); return; } else { MessageBox.Show("Bạn cần kết nối internet để kiểm tra cập nhật mới nhất!"); } } else if (DateTime.Now > key.Exdate) { MessageBox.Show("Máy bạn đã hết hạn sử dụng gói phần mềm này! \n Liên hệ : 00935.45.75.15 Vỹ Công Trần để được hướng dẫn"); LogFile.CreateFile(productName3 + ".txt"); return; } else { LogFile.DeleteFile(productName3 + ".txt"); } } catch { } } Application.Run(new Main(frmLogin.drUser, frmLogin.drPackage)); } }
public static void Main(string[] args) { if (args.Length == 0) { args = new string[] { "CBAPOS" } } ; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); DevExpress.UserSkins.BonusSkins.Register(); DevExpress.UserSkins.OfficeSkins.Register(); // DevExpress.Skins.SkinManager.EnableFormSkins(); //tuy theo moi soft co productName khac nhau string productName = "CBASFLOW"; //giá trị mặc định if (args.Length > 0) { productName = args[0]; } string H_KEY = "HKEY_CURRENT_USER\\Software\\SGD\\"; Config.NewKeyValue("H_KEY", H_KEY); Config.NewKeyValue("ProductName", productName); string subkey = @"Software\SGD\" + productName; string P_KEY = H_KEY + productName + "\\"; //lay style mac dinh cho form //RegisterNumber Config.NewKeyValue("H_KEY", P_KEY); RegistryKey pKey = Registry.CurrentUser.OpenSubKey(subkey); if (pKey == null) { Registry.CurrentUser.CreateSubKey(subkey); Registry.SetValue(P_KEY, "CompanyName", "SGD", RegistryValueKind.String); Registry.SetValue(P_KEY, "Created", "0", RegistryValueKind.DWord); Registry.SetValue(P_KEY, "isDemo", "0", RegistryValueKind.DWord); Registry.SetValue(P_KEY, "Language", "0", RegistryValueKind.DWord); Registry.SetValue(P_KEY, "Package", "7", RegistryValueKind.String); Registry.SetValue(P_KEY, "Password", "20-2C-B9-62-AC-59-07-5B-96-4B-07-15-2D-23-4B-70", RegistryValueKind.ExpandString); Registry.SetValue(P_KEY, "RegisterNumber", "", RegistryValueKind.String); Registry.SetValue(P_KEY, "SavePassword", "True", RegistryValueKind.String); Registry.SetValue(P_KEY, "StructDb", "SGD", RegistryValueKind.String); Registry.SetValue(P_KEY, "RemoteServer", "SGD", RegistryValueKind.String); Registry.SetValue(P_KEY, "Style", "Money Twins", RegistryValueKind.String); Registry.SetValue(P_KEY, "SupportOnline", "SGD", RegistryValueKind.String); Registry.SetValue(P_KEY, "UserName", "Admin", RegistryValueKind.String); Registry.SetValue(P_KEY, "isRemote", "False", RegistryValueKind.String); } //lay style mac dinh cho form string defaultStyle = Registry.GetValue(H_KEY, "Style", string.Empty).ToString(); DevExpress.LookAndFeel.DefaultLookAndFeel defaultLookAndFeelMain = new DevExpress.LookAndFeel.DefaultLookAndFeel(); if (defaultStyle != string.Empty) { defaultLookAndFeelMain.LookAndFeel.SetSkinStyle(defaultStyle); } //RegisterNumber string Company = Registry.GetValue(P_KEY, "CompanyName", "").ToString(); CPUid Cpu = new CPUid(Company + productName + "SGDEMTOnline"); string RegisterNumber = Registry.GetValue(P_KEY, "RegisterNumber", "").ToString(); if (RegisterNumber != Cpu.KeyString) { Config.NewKeyValue("isDemo", 1); if (MessageBox.Show("Bạn đang dùng phiên bản demo, bạn có muốn đăng ký lại không?", "Thông báo", MessageBoxButtons.YesNo) == DialogResult.Yes) { RegisterF rf = new RegisterF(); rf.producName = productName; rf.ShowDialog(); Config.NewKeyValue("isDemo", 0); if (rf.DialogResult == DialogResult.Cancel) { return; } } } else { Config.NewKeyValue("isDemo", 0); Config.NewKeyValue("CompanyName", Company); } //kiem tra so lieu da duoc khoi tao chua, neu chua thuc hien khoi tao so lieu string created = Registry.GetValue(P_KEY, "Created", 0).ToString(); if (created == "0") { CreateData frmCreateData = new CreateData(productName); frmCreateData.ShowDialog(); if (frmCreateData.DialogResult == DialogResult.Cancel) { return; } Registry.SetValue(P_KEY, "Created", 1); } //da co so lieu, bat dau thuc hien dang nhap SetEnvironment(); Login frmLogin = new Login(); frmLogin.ShowDialog(); //dang nhap thanh cong, bat dau su dung chuong trinh if (frmLogin.DialogResult != DialogResult.Cancel) { Application.Run(new Main(frmLogin.drUser, frmLogin.drPackage)); } }
private void HeatAssistcheckBox_Unchecked(object sender, RoutedEventArgs e) { OPCUAWorker.OPCUAWorker.WriteDi(OPCUAWorker.OPCUAWorkerPaths.HeatAssist_Flag_path, (bool)HeatAssistcheckBox.IsChecked); CreateData.AddOperatoAction(OPCObjects.user.Login, "Отключение ассистирования при напылении"); }
public static void Main(string[] args) { //args = new string[] { "CBA12" }; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); DevExpress.UserSkins.BonusSkins.Register(); DevExpress.UserSkins.OfficeSkins.Register(); DevExpress.Skins.SkinManager.EnableFormSkins(); //tuy theo moi soft co productName khac nhau string productName = "CDT"; //giá trị mặc định if (args.Length > 0) { productName = args[0]; } string H_KEY = "HKEY_CURRENT_USER\\Software\\Combosoft\\"; Config.NewKeyValue("H_KEY", H_KEY); Config.NewKeyValue("ProductName", productName); //lay style mac dinh cho form string defaultStyle = Registry.GetValue(H_KEY, "Style", string.Empty).ToString(); DevExpress.LookAndFeel.DefaultLookAndFeel defaultLookAndFeelMain = new DevExpress.LookAndFeel.DefaultLookAndFeel(); if (defaultStyle != string.Empty) { defaultLookAndFeelMain.LookAndFeel.SetSkinStyle(defaultStyle); } //RegisterNumber string subkey = @"Software\Combosoft\" + productName; string P_KEY = H_KEY + productName + "\\"; Config.NewKeyValue("H_KEY", P_KEY); RegistryKey pKey = Registry.CurrentUser.OpenSubKey(subkey); if (pKey == null) { Registry.CurrentUser.CreateSubKey(subkey); } string Company = Registry.GetValue(P_KEY, "CompanyName", "").ToString(); CPUid Cpu = new CPUid(Company + productName); string RegisterNumber = Registry.GetValue(P_KEY, "RegisterNumber", "").ToString(); if (RegisterNumber != Cpu.KeyString) { Cpu = new CPUid("BanDemo" + Company + "BanDemo" + productName); if (RegisterNumber != Cpu.KeyString) { RegisterF rf = new RegisterF(); rf.producName = productName; rf.ShowDialog(); if (rf.DialogResult == DialogResult.Cancel) { return; } } else { int nCount = 0; string path = System.Environment.SystemDirectory + "\\" + "Info.dat"; string[] contents = new string[3]; if (System.IO.File.Exists(path)) { contents = System.IO.File.ReadAllLines(path); nCount = Int32.Parse(contents[2]); } nCount++; contents[2] = nCount.ToString(); int nRemain = 100 - nCount; if (nRemain == 0) { MessageBox.Show("Phiên bản demo đã hết hạn sử dụng"); return; } else { System.IO.File.WriteAllLines(path, contents); if (MessageBox.Show("Bạn đang dùng phiên bản demo - (" + nRemain.ToString() + " lần), bạn có muốn đăng ký lại không?", "Thông báo", MessageBoxButtons.YesNo) == DialogResult.Yes) { RegisterF rf = new RegisterF(); rf.producName = productName; rf.ShowDialog(); } } } } //kiem tra so lieu da duoc khoi tao chua, neu chua thuc hien khoi tao so lieu string created = Registry.GetValue(P_KEY, "Created", 0).ToString(); if (created == "0") { CreateData frmCreateData = new CreateData(); frmCreateData.ShowDialog(); if (frmCreateData.DialogResult == DialogResult.Cancel) { return; } Registry.SetValue(P_KEY, "Created", 1); } //da co so lieu, bat dau thuc hien dang nhap SetEnvironment(); Login frmLogin = new Login(); frmLogin.ShowDialog(); //dang nhap thanh cong, bat dau su dung chuong trinh if (frmLogin.DialogResult != DialogResult.Cancel) { Application.Run(new Main(frmLogin.drUser, frmLogin.drPackage)); } }
public void DefaultOnSetup() { CreateData.FillTables(session); }
public static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); DevExpress.UserSkins.BonusSkins.Register(); DevExpress.UserSkins.OfficeSkins.Register(); DevExpress.Skins.SkinManager.EnableFormSkins(); //tuy theo moi soft co productName khac nhau string productName = "CDT"; //giá trị mặc định if (args.Length > 0) { productName = args[0]; } string H_KEY = "HKEY_CURRENT_USER\\Software\\Combosoft\\"; Config.NewKeyValue("H_KEY", H_KEY); Config.NewKeyValue("ProductName", productName); //lay style mac dinh cho form string defaultStyle = Registry.GetValue(H_KEY, "Style", string.Empty).ToString(); DevExpress.LookAndFeel.DefaultLookAndFeel defaultLookAndFeelMain = new DevExpress.LookAndFeel.DefaultLookAndFeel(); if (defaultStyle != string.Empty) { defaultLookAndFeelMain.LookAndFeel.SetSkinStyle(defaultStyle); } //RegisterNumber string P_KEY = H_KEY + productName + "\\"; string Company = Registry.GetValue(P_KEY, "CompanyName", "").ToString(); CPUid Cpu = new CPUid(Company + productName); string RegisterNumber = Registry.GetValue(P_KEY, "RegisterNumber", "").ToString(); if (RegisterNumber != Cpu.KeyString) { RegisterF rf = new RegisterF(); rf.producName = productName; rf.ShowDialog(); if (rf.DialogResult == DialogResult.Cancel) { return; } } //kiem tra so lieu da duoc khoi tao chua, neu chua thuc hien khoi tao so lieu string created = Registry.GetValue(P_KEY, "Created", 0).ToString(); if (created == "0") { CreateData frmCreateData = new CreateData(); frmCreateData.ShowDialog(); if (frmCreateData.DialogResult == DialogResult.Cancel) { return; } Registry.SetValue(P_KEY, "Created", 1); } //da co so lieu, bat dau thuc hien dang nhap SetEnvironment(); Login frmLogin = new Login(); frmLogin.ShowDialog(); //dang nhap thanh cong, bat dau su dung chuong trinh if (frmLogin.DialogResult != DialogResult.Cancel) { Application.Run(new Main(frmLogin.drUser, frmLogin.drPackage)); } }
public...CreateResource(CreateData input) { // ... }