partial void DeleteUser(User instance);
partial void UpdateUser(User instance);
partial void InsertUser(User instance);
public User ToDb(User user) { if (!string.IsNullOrEmpty(Name)) user.name = Name; if (!string.IsNullOrEmpty(Password)) user.password = Password; if (!string.IsNullOrEmpty(StoreData)) user.storedata = StoreData; if (!string.IsNullOrEmpty(CusFolder)) user.cusfolder = CusFolder; user.act = (int)Act; return user; }
public mUser(User u) { Id = u.id; Act = (eAct)u.act; Name = u.name; Password = u.password; StoreData = u.storedata; CusFolder = u.cusfolder; }
public int UserAdd(mUser newuser) { newuser.Password = Encrypt.EncryptUserPassword(newuser.Password); User user = new User(); user_repo.Add(newuser.ToDb(user)); SubmitChanges(); return user.id; }