public static DanhMucCollection SelectByLDMMa(SqlConnection con, string LDM_Ma) { var List = new DanhMucCollection(); var obj = new SqlParameter[1]; if (!string.IsNullOrEmpty(LDM_Ma)) { obj[0] = new SqlParameter("LDM_Ma", LDM_Ma); } else { obj[0] = new SqlParameter("LDM_Ma", DBNull.Value); } List.Add(new DanhMuc() { ID = Guid.Empty , Ten = string.Empty }); using (IDataReader rd = SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "sp_tblDanhMuc_Select_SelectByLDM_Ma_linhnx", obj)) { while (rd.Read()) { List.Add(getFromReader(rd)); } } return(List); }
public static DanhMucCollection SelectAll() { var List = new DanhMucCollection(); using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblDanhMuc_Select_SelectAll_linhnx")) { while (rd.Read()) { List.Add(getFromReader(rd)); } } return(List); }
/// <summary> /// Dành cho tư vấn /// </summary> /// <param name="TV_ID"></param> /// <returns></returns> public static DanhMucCollection SelectByTvId(string TV_ID) { var List = new DanhMucCollection(); var obj = new SqlParameter[1]; if (!string.IsNullOrEmpty(TV_ID)) { obj[0] = new SqlParameter("TV_ID", TV_ID); } else { obj[0] = new SqlParameter("TV_ID", DBNull.Value); } using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblDanhMuc_Select_SelectByTvId_linhnx", obj)) { while (rd.Read()) { List.Add(getFromReader(rd)); } } return(List); }
public static DanhMucCollection SelectParentByDmId(SqlConnection con, string DM_ID) { var list = new DanhMucCollection(); var obj = new SqlParameter[1]; if (!string.IsNullOrEmpty(DM_ID)) { obj[0] = new SqlParameter("DM_ID", DM_ID); } else { obj[0] = new SqlParameter("DM_ID", DBNull.Value); } using (IDataReader rd = SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "sp_tblDanhMuc_Select_SelectParentByDmId_linhnx", obj)) { while (rd.Read()) { list.Add(getFromReader(rd)); } } return(list); }
void sendmailThongbao(string email, string tieude, string noidung) { DanhMucCollection DanhMucHotro = DanhMucDal.SelectLangBased("", "LIENHE"); DanhMucCollection ListEmail = new DanhMucCollection(); foreach (DanhMuc item in DanhMucHotro) { if (item.Ma == "LH_EMAIL") { ListEmail.Add(item); } } if (ListEmail != null) { foreach (DanhMuc item in ListEmail) { omail.Send(item.GiaTri, email, tieude, noidung, "*****@*****.**", "chonongnghiep.com-ĐĂNG KÝ DỊCH VỤ THÀNH VIÊN", "123$5678"); } } }