/// <summary> /// 新增账户安全信息 /// </summary> /// <param name="basie">安全信息实体</param> /// <returns></returns> public static bool InsertAccountScurityInfo(Base_t_AccountScurityInfoEntity basie, out string message) { message = ""; bool retFlag = false; Base_t_AccountScurityInfo basi = new Base_t_AccountScurityInfo(); if (basie != null) { PublicFunction.ObjectCopyTo(basie, basi); AccountDataSourceDataContext adsdc = new AccountDataSourceDataContext(); try { if (basi != null && basie != null) { adsdc.Base_t_AccountScurityInfo.InsertOnSubmit(basi); adsdc.SubmitChanges(); retFlag = true; } } catch(Exception ex) { message = ex.Message; retFlag = false; } } else { retFlag = false; } return retFlag; }
public void UpdateAccountScurityInfoTest() { Base_t_AccountScurityInfoEntity basie = new Base_t_AccountScurityInfoEntity(); // TODO: 初始化为适当的值 basie.AccountId = 1; basie.WaitUpdateScurityEmail = "*****@*****.**"; basie.EmailValidateCode = "663763972m"; basie.EmailExpirationTime = DateTime.Now.AddMinutes(5); bool expected = false; // TODO: 初始化为适当的值 bool actual; actual = AccountScurityBusiness.UpdateAccountScurityInfo(basie); Assert.AreEqual(expected, actual); Assert.Inconclusive("验证此测试方法的正确性。"); }
/// <summary> /// 查询安全信息 /// </summary> /// <param name="sId"></param> /// <returns></returns> public static Base_t_AccountScurityInfoEntity SelectScurityInfo(int accountId) { //定义临时存储实体变量,便于一会实体转换和返回 Base_t_AccountScurityInfo basi = new Base_t_AccountScurityInfo(); Base_t_AccountScurityInfoEntity basie = new Base_t_AccountScurityInfoEntity(); AccountDataSourceDataContext adsdc = new AccountDataSourceDataContext(); basi = adsdc.Base_t_AccountScurityInfo.FirstOrDefault(p => p.accountId == accountId); if (basi != null) { PublicFunction.ObjectCopyTo(basi, basie); return basie; } else return null; }
public void InsertAccountScurityInfoTest() { Base_t_AccountScurityInfoEntity basie = new Base_t_AccountScurityInfoEntity() ; // TODO: 初始化为适当的值 basie.UseNumber = 3; basie.WaitUpdateScurityEmail = "*****@*****.**"; basie.WaitUpdateScurityTel = "12341234123"; basie.PayPassword = "******"; string message = string.Empty; // TODO: 初始化为适当的值 string messageExpected = string.Empty; // TODO: 初始化为适当的值 bool expected = false; // TODO: 初始化为适当的值 bool actual; actual = AccountScurityBusiness.InsertAccountScurityInfo(basie, out message); Assert.AreEqual(messageExpected, message); Assert.AreEqual(expected, actual); Assert.Inconclusive("验证此测试方法的正确性。"); }
/// <summary> /// 更新账户安全信息 /// </summary> /// <param name="baie">账户安全信息实体</param> /// <returns></returns> public static bool UpdateAccountScurityInfo(Base_t_AccountScurityInfoEntity basie) { bool retFlag = false; if (basie == null) return retFlag; Base_t_AccountScurityInfo basi = new Base_t_AccountScurityInfo(); AccountDataSourceDataContext adsdc = new AccountDataSourceDataContext(); basi = adsdc.Base_t_AccountScurityInfo.FirstOrDefault(p => p.accountId == basie.AccountId); try { if (basi != null && basie != null) { if( basie.AccountId > 0) basi.accountId = basie.AccountId; if (basie.EmailExpirationTime != null) basi.emailExpirationTime = basie.EmailExpirationTime; if (basie.TelExpirationTime != null) basi.telExpirationTime = basie.TelExpirationTime; if (!string.IsNullOrEmpty(basie.EmailValidateCode)) basi.emailValidateCode = basie.EmailValidateCode; if (!string.IsNullOrEmpty(basie.WaitUpdateScurityEmail)) basi.waitUpdateScurityEmail = basie.WaitUpdateScurityEmail; if (!string.IsNullOrEmpty(basie.WaitUpdateScurityTel)) basi.waitUpdateScurityTel = basie.WaitUpdateScurityTel; if (!string.IsNullOrEmpty(basie.TelValidateCode)) basi.telValidateCode = basie.TelValidateCode; if ( basie.UseNumber>0) basi.useNumber = basi.useNumber + basie.UseNumber; adsdc.SubmitChanges(); retFlag = true; } } catch { retFlag = false; } return retFlag; }
/// <summary> /// 更新账户安全信息 /// </summary> /// <param name="baie">账户安全信息实体</param> /// <returns></returns> public bool UpdateAccountScurityInfo(Base_t_AccountScurityInfoEntity baie) { return AccountScurityBusiness.UpdateAccountScurityInfo(baie); }
/// <summary> /// 新增账户安全信息 /// </summary> /// <param name="basie">安全信息实体</param> /// <returns></returns> public bool InsertAccountScurityInfo(Base_t_AccountScurityInfoEntity basie, out string message) { return AccountScurityBusiness.InsertAccountScurityInfo(basie,out message); }