private void AddDataRow(AccountInfoDTO accountInfo) { _sb.AppendLine("<tr>"); _sb.AppendLine("<td class=columnAccNr>"); _sb.AppendLine(accountInfo.AccountNumber.ToString()); _sb.AppendLine("</td>"); _sb.AppendLine("<td class=columnAccName>"); _sb.AppendLine(accountInfo.AccountName); _sb.AppendLine("</td>"); _sb.AppendLine("<td class=columnAccData>"); _sb.AppendLine(accountInfo.ResultReportCategory.ToString()); _sb.AppendLine("</td>"); _sb.AppendLine("<td class=columnAccData>"); _sb.AppendLine(accountInfo.PartsReportCategory.ToString()); _sb.AppendLine("</td>"); _sb.AppendLine("<td class=columnAccData>"); _sb.AppendLine(accountInfo.WeekCategory.ToString()); _sb.AppendLine("</td>"); _sb.AppendLine("<td class=columnAccData>"); _sb.AppendLine(accountInfo.IsIncome.ToString()); _sb.AppendLine("</td>"); _sb.AppendLine("<td class=columnAccYear>"); _sb.AppendLine("År"); _sb.AppendLine("</td>"); _sb.AppendLine("</tr>"); }
//消息体命令处理 public void Login(UserToken token, AccountInfoDTO value) { //TODO 判断是否登陆成功 int result = 1; write(token, LoginProtocol.LOGIN_SRES, result); }
public void RegSureRegClick() { if (regAccountInput.text.Length == 0 || regAccountInput.text.Length > 6) { WarningManager.errors.Add(new WarningModel("账号格式错误")); return; } if (regPassWordInput1.text.Length == 0 || regPassWordInput1.text.Length > 6) { WarningManager.errors.Add(new WarningModel("密码格式错误")); return; } if (!regPassWordInput1.text.Equals(regPassWordInput2.text)) { WarningManager.errors.Add(new WarningModel("两次密码输入不一致")); return; } //验证通过 申请注册 //关闭注册面板 //加载等待logo AccountInfoDTO dto = new AccountInfoDTO(); dto.account = regAccountInput.text; dto.password = regPassWordInput1.text; this.Write(GameProtocol.Protocol.TYPE_LOGIN, 0, Protocol.LoginProtocol.REG_CREQ, dto); RegCloseClick(); }
public void regpanelRegClick() { if (regAcountInput.text.Length == 0 || regAcountInput.text.Length > 6) { Debug.Log("账号不合法"); return; } if (regPwInput.text.Length == 0 || regPwInput.text.Length > 6) { Debug.Log("密码不合法"); return; } if (!regPwInput.text.Equals(regPw1Input.text)) { Debug.Log("两次输入密码不一致"); return; } //验证通过 申请注册 并关闭注册面板 AccountInfoDTO dto = new AccountInfoDTO(); dto.account = regAcountInput.text; dto.password = regPw1Input.text; this.WriteMessage(Protocol.TYPE_LOGIN, 0, LoginProtocol.REG_CREQ, dto); regCloseClick(); }
//消息体命令处理 public void Register(UserToken token, AccountInfoDTO value) { //TODO 判断是否注册成功 int result = 1; write(token, LoginProtocol.REG_SRES, result); }
public void RegAccount() { if (regAccountInput.text.Length == 0 || regAccountInput.text.Length > 6) { Debug.Log("账号错误"); return; } if (regPWInput.text.Length == 0 || regPWInput.text.Length > 6) { Debug.Log("密码错误"); return; } if (!regPWInput.text.Equals(regRepeatPW.text)) { Debug.Log("输入不一致"); return; } //验证通过,申请注册,并关闭注册面板 AccountInfoDTO dto = new AccountInfoDTO(); dto.account = regAccountInput.text.Trim(); dto.password = regPWInput.text.Trim(); NetIO.Instance.Write(Protocol.TYPE_LOGIN, 0, LoginProtocol.REG_CREQ, dto); RegCloseClick(); }
public void Edit(AccountInfoDTO EduDTO) { using (var container = new InventoryContainer()) { var Comp = new PayBankAccountInfo(); Comp = container.PayBankAccountInfoes.FirstOrDefault(o => o.AccountInfoId.Equals(EduDTO.AccountInfoId)); Comp.AccountInfoId = EduDTO.AccountInfoId; Comp.AccountName = EduDTO.AccountName; Comp.AccountNum = EduDTO.AccountNum; Comp.AccountTypeId = EduDTO.AccountTypeId; Comp.ActivationSatus = EduDTO.ActivationSatus; Comp.Address = EduDTO.Address; Comp.BankId = EduDTO.BankId; Comp.BranchName = EduDTO.BranchName; Comp.Mobile = EduDTO.Mobile; Comp.Phone = EduDTO.Phone; Comp.UpdateBy = EduDTO.UpdateBy; Comp.UpdateDate = EduDTO.UpdateDate; Comp.BrProId = EduDTO.BrProId; Comp = (PayBankAccountInfo)DTOMapper.DTOObjectConverter(EduDTO, Comp); container.SaveChanges(); } }
/// <summary> /// 处理消息 /// </summary> /// <param name="msg"></param> public override void ProcessEvent(MsgBase msg) { switch (msg.MsgId) { case (ushort)NetEventLogin.LoginRequest: MsgAccount accountMsg = msg as MsgAccount; AccountInfoDTO accountDTO = new AccountInfoDTO(); accountDTO.account = accountMsg.Account; accountDTO.password = accountMsg.Password; Tools.debuger.Log("申请登录."); Send(Protocol.Protocol.TYPE_LOGIN, 0, (int)LoginProtocol.LOGIN_CREQ, accountDTO); break; case (ushort)NetEventRegister.RegisterRequest: MsgAccount msgAccount = msg as MsgAccount; AccountInfoDTO dtoAccount = new AccountInfoDTO(); dtoAccount.account = msgAccount.Account; dtoAccount.password = msgAccount.Password; Tools.debuger.Log("申请新建一个账号."); Send(Protocol.Protocol.TYPE_LOGIN, 0, (int)LoginProtocol.REG_CREQ, dtoAccount); break; } }
private void AddDataRow(AccountInfoDTO accountInfo) { _sb.AppendLine("<tr>"); _sb.AppendLine("<td class=columnAccNr>"); _sb.AppendLine(accountInfo.AccountNumber.ToString()); _sb.AppendLine("</td>"); _sb.AppendLine("<td class=columnAccName>"); _sb.AppendLine(accountInfo.AccountName); _sb.AppendLine("</td>"); _sb.AppendLine("<td class=columnAccData>"); _sb.AppendLine(accountInfo.ResultReportCategory.ToString()); _sb.AppendLine("</td>"); _sb.AppendLine("<td class=columnAccData>"); _sb.AppendLine(accountInfo.PartsReportCategory.ToString()); _sb.AppendLine("</td>"); _sb.AppendLine("<td class=columnAccData>"); _sb.AppendLine(accountInfo.WeekCategory.ToString()); _sb.AppendLine("</td>"); _sb.AppendLine("<td class=columnAccData>"); _sb.AppendLine(accountInfo.IsIncome.ToString()); _sb.AppendLine("</td>"); _sb.AppendLine("<td class=columnAccYear>"); _sb.AppendLine("År"); _sb.AppendLine("</td>"); _sb.AppendLine("</tr>"); }
private void OnLoginClick() { print("login"); AccountInfoDTO dto = new AccountInfoDTO(); dto.account = inputUserName.text; dto.password = inputPassword.text; NetIO.Instance.write(Protocol.AreaProtocol.TYPE_LOGIN, 0, Protocol.LoginProtocol.LOGIN_CREQ, dto); }
public void Add(AccountInfoDTO DTO) { using (var container = new InventoryContainer()) { PayBankAccountInfo gur = new PayBankAccountInfo(); container.PayBankAccountInfoes.AddObject((PayBankAccountInfo)DTOMapper.DTOObjectConverter(DTO, gur)); container.SaveChanges(); } }
public void login(UserToken token, AccountInfoDTO value) { ExecutorPool.Instance.execute( delegate() { int result = accountBiz.login(token, value.account, value.password); write(token, LoginProtocol.LOGIN_SRES, result); } ); }
public void reg(UserToken token, AccountInfoDTO value) { ExecutorPool.Instance.execute( delegate() { int result = accountBiz.create(token, value.account, value.password); write(token, LoginProtocol.REG_SRES, SerializeUtil.SerEncode(result)); } ); }
/// <summary> /// 处理注册 /// </summary> public void Reg(UserToken token, AccountInfoDTO value) { ExecutorPool.Instance.Execute( delegate() { int result = accountBIZ.Create(token, value.account, value.password); Write(token, LoginProtocol.REG_SRES, result); }); }
public void UpdateOne(AccountInfoDTO accountCategory) { using (ISession session = NHibernateHelper.OpenSession()) using (ITransaction transaction = session.BeginTransaction()) { session.Update(accountCategory); transaction.Commit(); } }
public void login(UserToken token, AccountInfoDTO value) { ExecutorPool.Instance.execute ( delegate() { write(token, TypeProtocol.TYPE_LOGIN_CREQ, 0, LoginProtool.LOGIN_CREQ, biz.login(token, value.account, "0")); } ); }
private void Reg(UserToken token, AccountInfoDTO accountInfoDTO) { ExecutorPool.Instance.Execute( delegate() { int result = accountBiz.Create(token, accountInfoDTO.account, accountInfoDTO.password); Send(token, LoginProtocol.REG_SRES, result); } ); }
public void reg(UserToken token, AccountInfoDTO value) { ExecutorPool.Instance.execute( delegate() { ReturnDTO result = accountBiz.create(token, value.accountName, value.password); write(token, LoginProtocol.REG_SRES, result); } ); }
private static bool IsInCollection(AccountInfoDTO u, IEnumerable <AccountInfoDTO> fromDb) { foreach (var d in fromDb) { if (d.Id == u.Id && d.AccountNumber == u.AccountNumber && d.AccountName == u.AccountName && d.IsIncome == u.IsIncome && d.Year == u.Year && d.PartsReportCategory == u.PartsReportCategory && d.ResultReportCategory == u.ResultReportCategory && d.WeekCategory == u.WeekCategory) { return(true); } } return(false); }
public void CopyAccountInfo(int fromYear, int toYear) { var toAccounts = new List <AccountInfoDTO>(); var fromAccounts = _accountInfoRepository.GetAllByYear(fromYear); foreach (AccountInfoDTO account in fromAccounts) { AccountInfoDTO newAccount = account; newAccount.Year = toYear; toAccounts.Add(newAccount); } _accountInfoRepository.SaveMeny(toAccounts); }
private AccountInfoDTO CreateTestAccountInfo() { var accountInfo = new AccountInfoDTO(); accountInfo.AccountBalance = 100; accountInfo.AccountEquity = 100; accountInfo.AccountFreeMargin = 100; accountInfo.AccountId = "123"; accountInfo.AccountName = "Unit test account"; accountInfo.ApiKey = "111"; return(accountInfo); }
public void SetUp() { _accountInfoRepository = new AccountInfoRepository(); _accountInfo1 = new AccountInfoDTO { AccountNumber = 3001, AccountName = "testkonto1", IsIncome = true, PartsReportCategory = 1, ResultReportCategory = 1, WeekCategory = 1, Year = 2011 }; _accountInfo2 = new AccountInfoDTO { AccountNumber = 3002, AccountName = "testkonto2", IsIncome = true, PartsReportCategory = 2, ResultReportCategory = 2, WeekCategory = 2, Year = 2012 }; _accountInfo3 = new AccountInfoDTO { AccountNumber = 3003, AccountName = "testkonto3", IsIncome = true, PartsReportCategory = 3, ResultReportCategory = 3, WeekCategory = 3, Year = 2013 }; }
public void ShouldReturnSuccessStorageResultWhenSuccessful() { var inputModel = new AccountInfo { AccountNumber = 3000, AccountName = "Test", IsIncome = "Utgift", PartsReportCategory = "Udefinert", ResultReportCategory = "Udefinert", WeekCategory = "Udefinert", Year = 2011 }; var toDb = new AccountInfoDTO { AccountNumber = 3000, AccountName = "Test", IsIncome = false, PartsReportCategory = 0, ResultReportCategory = 0, WeekCategory = 0, Year = 2011 }; _accountInfoRepositoryMock.Setup(x => x.SaveOne(toDb)).Returns(StorageResult.Success); var result = _subject.SaveOneAccountInfo(inputModel); Assert.That(result, Is.EqualTo(StorageResult.Success)); }
public static AccountInfoDTO GetAccountInfo(LoginModel obj) { AccountInfoDTO accInfo = new AccountInfoDTO(); var dbContext = new ApplicationContext(); var sqlSting = "EXEC [dbo].[sp_GetAccountInfo] @UserName='******',@Password='******',@LoginType='" + obj.LoginType + "'"; accInfo = dbContext.Database.SqlQuery <AccountInfoDTO>(sqlSting).FirstOrDefault(); if (accInfo != null) { accInfo.SessionKey = obj.SessionKey; } return(accInfo); }
/// <summary> /// 登录 /// </summary> public void Login(string userName) { if (userName == "") { //ErrorModel m = new ErrorModel("用户名或密码不能为空"); errorManager.AddErrorModel("用户名不能为空"); } else { AccountInfoDTO dto = new AccountInfoDTO(); dto.account = userName; NetWorkScript.Instance.write(TypeProtocol.TYPE_LOGIN_BRQ, 0, LoginProtool.LOGIN_BRQ, dto); } }
public AccountInfo MapOneForView(AccountInfoDTO accountInfo) { return(new AccountInfo { Id = accountInfo.Id, AccountNumber = accountInfo.AccountNumber, AccountName = accountInfo.AccountName, ResultReportCategory = ((ResultReportCategory)accountInfo.ResultReportCategory).ToString(), PartsReportCategory = ((PartsReportCategory)accountInfo.PartsReportCategory).ToString(), WeekCategory = ((WeekCategory)accountInfo.WeekCategory).ToString(), IsIncome = ((IsIncome)Convert.ToInt32(accountInfo.IsIncome)).ToString(), Year = accountInfo.Year, NumberAndName = accountInfo.AccountNumber + ", " + accountInfo.AccountName }); }
static byte[] login() { AccountInfoDTO accountInfoDTO = new AccountInfoDTO(); accountInfoDTO.accountName = "admin"; accountInfoDTO.password = "******"; SocketModel model = new SocketModel(); model.type = TypeProtocol.TYPE_LOGIN; model.area = 0; model.command = LoginProtocol.LOGIN_CREQ; model.message = accountInfoDTO; var message = MessageEncoding.encode(model); return(LengthEncoding.encode(message)); }
public StorageResult DeleteOne(AccountInfoDTO accountCategory) { try { using (ISession session = NHibernateHelper.OpenSession()) using (ITransaction transaction = session.BeginTransaction()) { session.Delete(accountCategory); transaction.Commit(); } return(StorageResult.Success); } catch (Exception) { return(StorageResult.Failed); } }
public void Messagereceive(UserToken token, SocketModel message) { AccountInfoDTO dto = message.getMessage <AccountInfoDTO>(); switch (message.command) { case LoginProtool.LOGIN_BRQ: login(token, dto); break; default: break; } //ExecutorPool.Instance.execute // ( // delegate() // { // //RoomListDTO a = new RoomListDTO(); // // RoomInfoDTO b = new RoomInfoDTO(); // // b.roomID = "fw"; // // b.roomName = "33"; // // b.roomOwner = "哈"; // // b.roomState = "正在准备"; // // a.roomList[0] = b; // //RoomListDTO a = new RoomListDTO(); // //a.roomList=new RoomInfoDTO[15]; // //RoomInfoDTO b = new RoomInfoDTO(); // //b.roomID = "fw"; // //b.roomName = "33"; // //b.roomOwner = "哈"; // //b.roomState = "正在准备"; // //for (int i = 0; i < 15; i++) // //{ // // a.roomList[i] = b; // //} // //write(token, MainProtocol.TYPE_GAMEHALL, GameHallProtocol.GAMEHALL_ROOMLIST, 0, a); // } // ); }
private static IEnumerable <AccountInfoDTO> ConvertDataSetToObjectCollection(DataSet dataSet, int year) { var allAccountInfos = new List <AccountInfoDTO>(); foreach (DataRow row in dataSet.Tables["AccountInfo"].Rows) { if (row[0].ToString() != "") { var newAccountInfo = new AccountInfoDTO(); newAccountInfo.AccountNumber = Convert.ToInt32(row[0].ToString()); newAccountInfo.AccountName = "Udefinert"; newAccountInfo.ResultReportCategory = Convert.ToInt32(row[2].ToString()); newAccountInfo.PartsReportCategory = Convert.ToInt32(row[3].ToString()); newAccountInfo.WeekCategory = Convert.ToInt32(row[4].ToString()); newAccountInfo.IsIncome = Convert.ToBoolean(Convert.ToInt32(row[5].ToString())); newAccountInfo.Year = year; allAccountInfos.Add(newAccountInfo); } } return(allAccountInfos); }
//private void Start() //{ // NetIO io = NetIO.Instance; //} public void LoginOnClick() { if (accountInput.text.Length == 0 || accountInput.text.Length > 6) { WarrningManager.errors.Add(new WarningModel("账号不合法")); Debug.Log("账号不合法"); return; } if (passWordInput.text.Length == 0 || passWordInput.text.Length > 6) { Debug.Log("密码不合法"); return; } //验证通过 申请登录 //loginBtn.interactable = false; AccountInfoDTO dto = new AccountInfoDTO(); dto.account = accountInput.text; dto.password = passWordInput.text; this.WriteMessage(GameProtocol.Protocol.TYPE_LOGIN, 0, LoginProtocol.LOGIN_CREQ, dto); loginBtn.interactable = false; }