public string ManageUsers(BLData obj) { string result = string.Empty; if (obj._USERID == null) { obj._USERID = 0; } string queryString = "CALL SP_MANAGEUSER(?_USERID, ?_USERCODE, ?_FIRSTNAME, ?_LASTNAME, ?_PASSWORD, ?_EMAILID, ?_ACTIVE, ?_CREATEDBY, ?_CREATEDON, ?_MODE)"; MySqlParameter[] mySqlParam = new MySqlParameter[10]; mySqlParam[0] = CreateParameters(DbType.Int32, obj._USERID, "?_USERID", ParameterDirection.Input); mySqlParam[1] = CreateParameters(DbType.String, obj._USERCODE, "?_USERCODE", ParameterDirection.Input); mySqlParam[2] = CreateParameters(DbType.String, obj._FIRSTNAME, "?_FIRSTNAME", ParameterDirection.Input); mySqlParam[3] = CreateParameters(DbType.String, obj._LASTNAME, "?_LASTNAME", ParameterDirection.Input); mySqlParam[4] = CreateParameters(DbType.String, obj._PASSWORD, "?_PASSWORD", ParameterDirection.Input); mySqlParam[5] = CreateParameters(DbType.String, obj._EMAILID, "?_EMAILID", ParameterDirection.Input); mySqlParam[6] = CreateParameters(DbType.String, obj._ACTIVE, "?_ACTIVE", ParameterDirection.Input); mySqlParam[7] = CreateParameters(DbType.Int32, obj._CREATEDBY, "?_CREATEDBY", ParameterDirection.Input); mySqlParam[8] = CreateParameters(DbType.String, obj._CREATEDON, "?_CREATEDON", ParameterDirection.Input); mySqlParam[9] = CreateParameters(DbType.String, obj._MODE, "?_MODE", ParameterDirection.Input); return((string)MySqlHelper.ExecuteScalar(connectionString, queryString, mySqlParam)); }
public DataSet GetAllUsers(BLData obj) { string queryString = "CALL SP_GET_ALLUSERS()"; DataSet _ds = (DataSet)MySqlHelper.ExecuteDataset(connectionString, queryString); return(_ds); }
public DataSet GetUsers(BLData obj) { if (obj._MODE == "BYUSERID") { return(GetUserByUserID(obj)); } else if (obj._MODE == "GETALL") { return(GetAllActiveUsers(obj)); } else { return(SearchUser(obj)); } }
public string ManageUsers(int _USERID, string _USERCODE, string _FIRSTNAME, string _LASTNAME, string _PASSWORD, string _EMAILID, string _ACTIVE, int _CREATEDBY, string _CREATEDON, string _MODE) { using (BLData objbl = new BLData()) { objbl._USERID = Convert.ToInt32(_USERID); objbl._USERCODE = _USERCODE; objbl._FIRSTNAME = _FIRSTNAME; objbl._LASTNAME = _LASTNAME; objbl._PASSWORD = _PASSWORD; objbl._EMAILID = _EMAILID; objbl._ACTIVE = _ACTIVE; objbl._CREATEDBY = Convert.ToInt32(_CREATEDBY); objbl._CREATEDON = _CREATEDON; objbl._MODE = _MODE; //================== return(objbl.ManageUsers()); //================== } }
public DataSet GetUserByUserID(BLData obj) { string queryString = "CALL SP_MANAGEUSER(?_USERID, ?_USERCODE, ?_FIRSTNAME, ?_LASTNAME, ?_PASSWORD, ?_EMAILID, ?_ACTIVE, ?_CREATEDBY, ?_CREATEDON, ?_MODE)"; MySqlParameter[] mySqlParam = new MySqlParameter[10]; mySqlParam[0] = CreateParameters(DbType.Int32, obj._USERID, "?_USERID", ParameterDirection.Input); mySqlParam[1] = CreateParameters(DbType.String, "", "?_USERCODE", ParameterDirection.Input); mySqlParam[2] = CreateParameters(DbType.String, "", "?_FIRSTNAME", ParameterDirection.Input); mySqlParam[3] = CreateParameters(DbType.String, "", "?_LASTNAME", ParameterDirection.Input); mySqlParam[4] = CreateParameters(DbType.String, "", "?_PASSWORD", ParameterDirection.Input); mySqlParam[5] = CreateParameters(DbType.String, "", "?_EMAILID", ParameterDirection.Input); mySqlParam[6] = CreateParameters(DbType.String, "", "?_ACTIVE", ParameterDirection.Input); mySqlParam[7] = CreateParameters(DbType.Int32, "1", "?_CREATEDBY", ParameterDirection.Input); mySqlParam[8] = CreateParameters(DbType.String, "1800-01-01", "?_CREATEDON", ParameterDirection.Input); mySqlParam[9] = CreateParameters(DbType.String, obj._MODE, "?_MODE", ParameterDirection.Input); DataSet _ds = (DataSet)MySqlHelper.ExecuteDataset(connectionString, queryString, mySqlParam); return(_ds); }
public GetUser[] GetUsers(int _USERID, string _USERCODE, string _FIRSTNAME, string _LASTNAME, string _PASSWORD, string _EMAILID, string _ACTIVE, int _CREATEDBY, string _CREATEDON, string _MODE) { List <GetUser> returnObj = new List <GetUser>(); using (BLData obj = new BLData()) { //============ obj._USERID = _USERID; obj._USERCODE = _USERCODE; obj._FIRSTNAME = _FIRSTNAME; obj._LASTNAME = _LASTNAME; obj._PASSWORD = _PASSWORD; obj._EMAILID = _EMAILID; obj._ACTIVE = _ACTIVE; obj._CREATEDBY = _CREATEDBY; obj._CREATEDON = _CREATEDON; obj._MODE = _MODE; //============ DataSet ds = obj.GetUsers(); //============ foreach (DataRow item in ds.Tables[0].Rows) { returnObj.Add(new GetUser() { USERID = Convert.ToInt32(item["USERID"]), USERCODE = Convert.ToString(item["USERCODE"]), FIRSTNAME = Convert.ToString(item["FIRSTNAME"]), LASTNAME = Convert.ToString(item["LASTNAME"]), DISPLAYNAME = Convert.ToString(item["DISPLAYNAME"]), PASSWORD = Convert.ToString(item["PASSWORD"]), EMAILID = Convert.ToString(item["EMAILID"]), ACTIVE = Convert.ToString(item["ACTIVE"]), }); } } return(returnObj.ToArray()); }