public MainWindow() { InitializeComponent(); dc = new DBModelDataContext(); cbViews.ItemsSource = userViews; cbSpaces.ItemsSource = userSpaces; lvl2Controls = new List <Control>(); lvl2Controls.Add(btnNewSpace); lvl1Controls = new List <Control>(); lvl1Controls.Add(cbViews); lvl1Controls.Add(cbSpaces); lvl1Controls.Add(btnOpenSpace); lvl1Controls.Add(btnOpenView); lvl1Controls.AddRange(lvl2Controls); SwitchControls(0); SwitchDrawControls(-1); currules = new DrawingRules(); cbPointNormal.ItemsSource = DrawingRules.AllColors; cbPointSelected.ItemsSource = DrawingRules.AllColors; cbLineNormal.ItemsSource = DrawingRules.AllColors; cbLineNormal.ItemsSource = DrawingRules.AllColors; cbFaceNormal.ItemsSource = DrawingRules.AllColors; cbFaceSelected.ItemsSource = DrawingRules.AllColors; }
public static void RegisterNewUser(string login, string password, int access_type) { using (DBModelDataContext dc = new DBModelDataContext()) { Users newuser = new Users() { USER_ID = Guid.NewGuid(), Name = login, Password = password, Access_type = access_type }; dc.Users.InsertOnSubmit(newuser); dc.SubmitChanges(); } }
public static bool IsLoginExist(string login) { bool res = false; using (DBModelDataContext dc = new DBModelDataContext()) { var qauth = from u in dc.Users where u.Name == login select u; if (qauth.Count() != 0) { res = true; } } return(res); }
public UserControlWindow() { InitializeComponent(); dc = new DBModelDataContext(); cbAllUsers.ItemsSource = dc.Users; }
public LoginWindow() { InitializeComponent(); dc = new DBModelDataContext(); }