public int SetUserPermition(LoginOL setUSer) { using (IDbConnection db = new SqlConnection(dbConnection)) { string sqlQuery = "insert into Users(UserName,Password,IsDeleted,CreatedBy,CreatedDate)values('" + setUSer.username + "','" + setUSer.password.Trim() + "','0','" + setUSer.CreatedBy + "','" + DateTime.Now + "')"; int rowsAffected = db.Execute(sqlQuery, setUSer); return(rowsAffected); } }
public int SetUserPermition(LoginOL Users) { int rowAffected = new SetUserBL().setUSer(Users); if (rowAffected > 0) { return(rowAffected); } else { return(0); } }
public List <LoginOL> CheckLogin(string username, string password) { List <LoginOL> oblistol = new List <LoginOL>(); sqlfunc sqf = new sqlfunc(); sqf.cmd.CommandText = "CheckLogin"; sqf.cmd.Parameters.AddWithValue("@UserName", username); sqf.cmd.Parameters.AddWithValue("@Password", password); DataTable dt = new DataTable(); SqlDataAdapter adp = new SqlDataAdapter(sqf.cmd); adp.Fill(dt); if (dt.Rows.Count > 0) { LoginOL objlogin = new LoginOL(); objlogin.username = dt.Rows[0]["UserName"].ToString(); objlogin.password = dt.Rows[0]["Password"].ToString(); oblistol.Add(objlogin); } sqf.Dispose(); return(oblistol); }
public int setUSer(LoginOL setUser) { int rowAffected = new SetUserDL().SetUserPermition(setUser); return(rowAffected); }