コード例 #1
0
ファイル: Users.cs プロジェクト: v1tal1tysp/NewRepo
 public Users(string Username, string Paswordtext, string Firstname, string LastName, string Email, Usertype type)
 {
     this.Username    = Username;
     this.Paswordtext = stringUtil.Crypt(Paswordtext);
     this.Firstname   = Firstname;
     this.LastName    = LastName;
     this.Email       = Email;
     this.type        = type;
 }
コード例 #2
0
        public static Usertype GetOrInsert(string name)
        {
            try
            {
                Usertype usertype = DB.Usertype.Find(x => x.name == name).FirstOrDefault();
                if (usertype == null)
                {
                    Usertype newuser = new Usertype(name);
                    DB.Usertype.InsertOne(newuser);
                    return(newuser);
                }

                return(usertype);
            }
            catch (Exception e)
            {
                throw new Exception("Erro Inserir Utilizador" + e.ToString());
            }
        }
コード例 #3
0
ファイル: Users.cs プロジェクト: v1tal1tysp/NewRepo
        public static bool Insert(string Username, string Paswordtext, string Firstname, string LastName, string Email, Usertype type)
        {
            try
            {
                Users newuser = new Users(Username, Paswordtext, Firstname, LastName, Email, type);
                DB.User.InsertOne(newuser);

                return(true);
            }
            catch (Exception e)
            {
                throw new Exception("Erro Inserir Utilizador" + e.ToString());
            }
        }