public DataTable getRoleList() { string query = string.Format($"select * from Roles"); DataTable dt = cq.GetData(query); return(dt); }
public string getRole(string username) { string query = string.Format($"select roleid from Users where username='******'"); DataTable dt = cq.GetData(query); return(dt.Rows[0][0].ToString()); }
public DataTable getNhaPhanPhoiDetail(string mahanghoa) { CommonQuery cq = new CommonQuery(); string query = string.Format($"select * from NHAPHANPHOI where MaNPP = '{mahanghoa}'"); DataTable dt = cq.GetData(query); return(dt); }
public DataTable getKhuVucDetail(string mahanghoa) { CommonQuery cq = new CommonQuery(); string query = string.Format($"select * from KHUVUC where MaKhuVuc = '{mahanghoa}'"); DataTable dt = cq.GetData(query); return(dt); }
public DataTable getKhachHangDetail(string mahanghoa) { CommonQuery cq = new CommonQuery(); string query = string.Format($"select * from KHACHHANG where MAKH = '{mahanghoa}'"); DataTable dt = cq.GetData(query); return(dt); }
public DataTable getBangNhomHangDetail(string mahanghoa) { CommonQuery cq = new CommonQuery(); string query = string.Format($"select * from BANGNHOMHANG where MaNH = '{mahanghoa}'"); DataTable dt = cq.GetData(query); return(dt); }
public DataTable getBanDonViDetail(string mahanghoa) { CommonQuery cq = new CommonQuery(); string query = string.Format($"select * from BANGDONVI where MaDV = '{mahanghoa}'"); DataTable dt = cq.GetData(query); return(dt); }
public DataTable getHangHoaDetail(string mahanghoa) { CommonQuery cq = new CommonQuery(); string query = string.Format($"select * from HANGHOA where MaHH = '{mahanghoa}'"); DataTable dt = cq.GetData(query); return(dt); }
public DataTable getHangHoa() { CommonQuery cq = new CommonQuery(); string query = string.Format($"select * from HANGHOA"); DataTable dt = cq.GetData(query); return(dt); }
public DataTable getBangNhomHang() { CommonQuery cq = new CommonQuery(); string query = string.Format($"select * from BANGNHOMHANG"); DataTable dt = cq.GetData(query); return(dt); }
public DataTable getBanDonVi() { CommonQuery cq = new CommonQuery(); string query = string.Format($"select * from BANGDONVI"); DataTable dt = cq.GetData(query); return(dt); }
public DataTable getKho() { CommonQuery cq = new CommonQuery(); string query = string.Format($"select * from Kho"); DataTable dt = cq.GetData(query); return(dt); }
public DataTable getComboBoxRoles() { CommonQuery cq = new CommonQuery(); string query = string.Format($"select * from Roles"); DataTable dt = cq.GetData(query); return(dt); }
public DataTable getUserDetail(string mahanghoa) { CommonQuery cq = new CommonQuery(); string query = string.Format($"select r.*,u.* from Users u join Roles r on u.roleid = r.roleid where userid = '{mahanghoa}'"); DataTable dt = cq.GetData(query); return(dt); }
public int updateUser(DTOUser hanghoa) { CommonQuery cq = new CommonQuery(); string query2 = string.Format($"select * from Roles where rolename = '{hanghoa.rolename}'"); DataTable dt2 = cq.GetData(query2); hanghoa.roleid = dt2.Rows[0]["roleid"].ToString(); string query = string.Format($"update Users set userpassword='******',roleid='{hanghoa.roleid}',isactive='{hanghoa.isactive}' where userid = '{hanghoa.userid}'"); int dt = cq.ExecNonQuery(query); return(dt); }
public bool insertUser(DTOUser hanghoa) { CommonQuery cq = new CommonQuery(); string query = string.Format($"select * from Users where userid = '{hanghoa.userid}'"); if (cq.ExecSelectedCount(query) > 0) { return(false); } string query2 = string.Format($"select * from Roles where rolename = '{hanghoa.rolename}'"); DataTable dt2 = cq.GetData(query2); hanghoa.roleid = dt2.Rows[0]["roleid"].ToString(); query = string.Format($"insert into Users values('{hanghoa.userid}','{hanghoa.username}'," + $"'{hanghoa.userpassword}','{hanghoa.userfullname}','{hanghoa.roleid}','{hanghoa.isactive}')"); int dt = cq.ExecNonQuery(query); return(true); }