Exemplo n.º 1
0
        public int addNewUser(string userName, string password, string Email, string address, String phoneNo)
        {
            /*if
               * getUserwithSameName() returns null then go ahead and
               * AddNewUser();
               * then AddUserInfo()
               * then setPassword()
               *
               * */
            int insertionsuccess = -1;
            DAL.pyatLevelDSTableAdapters.tbluserTableAdapter useradapter = new tbluserTableAdapter();
            DAL.pyatLevelDSTableAdapters.tbluserinfoTableAdapter infoAdapter = new tbluserinfoTableAdapter();
            DAL.pyatLevelDSTableAdapters.tblpasswordTableAdapter passwordAdapter = new tblpasswordTableAdapter();

            if (useradapter.GetUserIDByName(userName) != null)
            {
                //we got result back. Which means there is a user with the same name.
                return -1;
            }
            else
            {
                try
                {

                    int userid = addNewUser(userName, address, 0);
                    int success = infoAdapter.AddUserInfo(userid, userName, address, phoneNo, Email);
                    insertionsuccess = passwordAdapter.SetPasswordInfo(password, password, 0, userid);
                }
                catch
                {
                }

            }

            return insertionsuccess;
        }
Exemplo n.º 2
0
        public pyatLevelDS.tbluserinfoDataTable GetUserInfoByUserID(int userID)
        {
            tbluserinfoTableAdapter adapter = new tbluserinfoTableAdapter();
            pyatLevelDS.tbluserinfoDataTable tbl = new pyatLevelDS.tbluserinfoDataTable();
            try
            {
                tbl = adapter.GetUserinfoByUserId(userID);

            }
            catch
            {

            }

            return tbl;
        }
Exemplo n.º 3
0
 public int addUserInfo(int UniqueID, string UserName, string Qustion, string Answer, string Email)
 {
     tbluserinfoTableAdapter adapter = new tbluserinfoTableAdapter();
     return adapter.AddUserInfo(UniqueID, UserName, Qustion, Answer, Email);
 }
Exemplo n.º 4
0
 public int UpdateUserInfoByUserInfoID(Int32 userinfoid, string UserName, string Address, string Phone, string Email)
 {
     DAL.pyatLevelDSTableAdapters.tbluserinfoTableAdapter infoAdapter = new tbluserinfoTableAdapter();
     return infoAdapter.UpdateUserInfoByUserInfoID(UserName, Address, Phone, Email, userinfoid);
 }