Ejemplo n.º 1
0
        public int createNewUser(User_Details _user, string type)
        {
            DBHelper helper = new DBHelper();
            SqlParameter[] param = new SqlParameter[6];
            param[0] = new SqlParameter(CONSTANT.UID, _user.User_ID);
            param[1] = new SqlParameter(CONSTANT.USER_NAME, _user.User_Name);
            param[2] = new SqlParameter(CONSTANT.PASSWORD, _user.User_Password);
            param[3] = new SqlParameter(CONSTANT.DESIGNATION, _user.User_Designation);
            param[4] = new SqlParameter(CONSTANT.USER_EMAIL, _user.User_Email);
            param[5] = new SqlParameter(CONSTANT.TYPE, type);


            int res = helper.InsertQuery(PROCEDURES.ADD_NEW_USER, param);

            return res;



        }
Ejemplo n.º 2
0
      public string LoginCheck(User_Details _user)
      {

          DBHelper helper = new DBHelper();
          SqlParameter []param=new SqlParameter[2];
          param[0]=new SqlParameter(CONSTANT.UID,_user.User_ID);

          string flag = string.Empty;
          param[1]=new SqlParameter(CONSTANT.PASSWORD,_user.User_Password);
           DataTable dt= helper.executeSelectQuery(PROCEDURES.LOGIN_CHECK, param).Tables[0];
           if (dt != null && dt.Rows.Count > 0)
           {

               foreach (DataRow item in dt.Rows)
               {
                   flag = item["Role_Name"].ToString();      
               }

           }
           return flag;
      
      }