partial void Deleteusers(users instance);
public void SetOwner(users owner) { _owner = owner; }
partial void Insertusers(users instance);
partial void Updateusers(users instance);
private void attach_users(users entity) { this.SendPropertyChanging(); entity.cities = this; }
private void detach_users(users entity) { this.SendPropertyChanging(); entity.cities = null; }
public User(users u) { _u = u; }
public User(users u, List<string> fields) { _u = u; _fields.AddRange(fields); }
public void SetUser(string token) { _u = DataBase.Users.GetByAccess(token); }
public UserView(users u) { _u = u; _acc = new AccountView(_u.accounts); }
public MissionNew(users u) { _u = u; }
public MissionNew() { _u = new users(); title = GlobalRes.Title; description = GlobalRes.Description; city = GlobalRes.City; }
public Additional(mission m, users u) { _m = m; }
/* public static bool create(string login, string password, string email, string tel) { int dat = Time.UNIXNow(); var acc = new accounts() { login = login, password = password, email = email, tel = tel, confirmation = CreateMD5Hash(login + dat.ToString()) }; context.accounts.InsertOnSubmit(acc); try { Save(); var user = new users() { name = "В процессе...", owner = acc.ID }; context.users.InsertOnSubmit(user); Save(); return true; } catch { return false; } } */ public static bool create(RegistrationView acc) { int dat = Time.UNIXNow(); var accnew = new accounts() { password = acc.password, email = acc.email, confirmation = "none" }; context.accounts.InsertOnSubmit(accnew); try { Save(); var user = new users() { name = "в процессе..", owner = accnew.ID }; context.users.InsertOnSubmit(user); return Save(); } catch { return false; } }
public static bool IsMissionAgent(int mid, users user) { var miss = context.mission.FirstOrDefault(m => m.ID == mid); if (miss != null) return miss.agent == user.ID; return false; }