コード例 #1
0
 partial void UpdateUserProfile(UserProfile instance);
コード例 #2
0
 partial void DeleteUserProfile(UserProfile instance);
コード例 #3
0
 partial void InsertUserProfile(UserProfile instance);
コード例 #4
0
 /// <summary>
 /// Insert a new record to [UserProfile] database.If success return [Id],otherwise, return -1
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public int Insert(MemberShow item)
 {
     s26webDataContext db = new s26webDataContext();
     if (db.UserProfile.FirstOrDefault(f => f.Account_Phone.ToLower() == item.Account_Phone.ToLower()) == null)
     {
         UserProfile new_item = new UserProfile
         {
             Account_Phone = item.Account_Phone,
             Password = Get_HashPassword(item.Password),
             Name = item.Name,
             Level = item.Level,
             Enable = item.Enable,
             CreateTime = DateTime.UtcNow
         };
         db.UserProfile.InsertOnSubmit(new_item);
         db.SubmitChanges();
         db.Connection.Close();
         return new_item.Id;
     }
     else
     {
         db.Connection.Close();
         return -1;
     }
 }