public int Login(ref string ReturnDescription) { DataTable table = new Tables.T_ElectronTicketAgents().Open("", "ID=" + this.ID, ""); if ((table == null) || (table.Rows.Count < 1)) { ReturnDescription = "用户不存在"; return(-1); } if (table.Rows[0]["Password"].ToString() != PF.EncryptPassword(this.Password)) { ReturnDescription = "密码错误"; return(-2); } if (table.Rows[0]["State"].ToString() != "1") { ReturnDescription = "代理商帐号已经过期"; return(-2); } this.Name = table.Rows[0]["Name"].ToString(); this.Password = table.Rows[0]["Password"].ToString(); this.Company = table.Rows[0]["Company"].ToString(); this.Url = table.Rows[0]["Url"].ToString(); this.Balance = Convert.ToDouble(table.Rows[0]["Balance"].ToString()); this.State = _Convert.StrToShort(table.Rows[0]["State"].ToString(), 0); this.UseLotteryList = table.Rows[0]["UseLotteryList"].ToString(); this.IPAddressLimit = table.Rows[0]["IPAddressLimit"].ToString(); this.SaveUserIDToCookie(); return(0); }
public int EditByID(ref string ReturnDescription) { if (this.ID < 0) { throw new Exception("CardPassword 尚未初始化到具体的数据实例上,请先使用 GetInformation 等获取数据信息"); } DataTable table = new Tables.T_ElectronTicketAgents().Open("", "[ID] = " + this.ID, ""); if ((table == null) || (table.Rows.Count < 1)) { ReturnDescription = "数据库读写错误"; return(-1); } new Tables.T_ElectronTicketAgents { Balance = { Value = this.Balance }, Company = { Value = this.Company }, Password = { Value = this.Password }, Name = { Value = this.Name }, State = { Value = this.State }, Url = { Value = this.Url }, UseLotteryList = { Value = this.UseLotteryList }, IPAddressLimit = { Value = this.IPAddressLimit } }.Update("[ID] = " + this.ID.ToString()); return(0); }
public int GetInformationByName(ref string ReturnDescription) { if (this.Name == "") { throw new Exception("CardPassword 尚未初始化到具体的数据实例上,请先使用 GetInformation 等获取数据信息"); } DataTable table = new Tables.T_ElectronTicketAgents().Open("", "[Name] = " + Utility.FilteSqlInfusion(this.Name), ""); if ((table == null) || (table.Rows.Count < 1)) { ReturnDescription = "数据库读写错误"; return(-1); } this.ID = _Convert.StrToInt(table.Rows[0]["ID"].ToString(), 0); this.Password = table.Rows[0]["Password"].ToString(); this.Company = table.Rows[0]["Company"].ToString(); this.Url = table.Rows[0]["Url"].ToString(); this.Balance = Convert.ToDouble(table.Rows[0]["Balance"].ToString()); this.State = _Convert.StrToShort(table.Rows[0]["State"].ToString(), 0); this.UseLotteryList = table.Rows[0]["UseLotteryList"].ToString(); this.IPAddressLimit = table.Rows[0]["IPAddressLimit"].ToString(); return(0); }