Exemplo n.º 1
0
 public void Update(DS_Members Members)
 {
     using (var ct = new DS_MembersDataContext(DbHelperSQL.Connection))
     {
         ct.DS_Members.Attach(Members, true);
         ct.SubmitChanges();
     }
 }
Exemplo n.º 2
0
 public void Add(DS_Members Members)
 {
     using (var ct = new DS_MembersDataContext(DbHelperSQL.Connection))
     {
         ct.DS_Members.InsertOnSubmit(Members);
         ct.SubmitChanges();
     }
 }
Exemplo n.º 3
0
 public void Delete(int ID)
 {
     using (var ct = new DS_MembersDataContext(DbHelperSQL.Connection))
     {
         DS_Members st = ct.DS_Members.Single(a => a.ID == ID);
         ct.DS_Members.DeleteOnSubmit(st);
         ct.SubmitChanges();
     }
 }
Exemplo n.º 4
0
 public bool Login(ref DS_Members Member)
 {
     using (var ct = new DS_MembersDataContext(DbHelperSQL.Connection))
     {
         string uid = Member.UserID.Trim(), pwd = Member.Password.Trim();
         Member = ct.DS_Members.SingleOrDefault(a => a.UserID == uid && a.Password == pwd);
         return(!object.Equals(Member, null));
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// 注册
 /// </summary>
 /// <param name="Member"></param>
 /// <param name="Company"></param>
 public void Register(DS_Members Member, DS_CompanyInfo Company)
 {
     using (DbConnection con = DbHelperSQL.GetConnection())
     {
         var tran = con.BeginTransaction();
         var mbct = new DS_MembersDataContext(con);
         mbct.Transaction = tran;
         mbct.DS_Members.InsertOnSubmit(Member);
         mbct.SubmitChanges();
         var comct = new DS_CompanyInfoDataContext(con);
         comct.Transaction = tran;
         Company.MenberID  = Member.ID;
         comct.DS_CompanyInfo.InsertOnSubmit(Company);
         comct.SubmitChanges();
         tran.Commit();
     }
 }