public static string formatAdvChiTietKieu1(QuangCao item, string domain) { StringBuilder sb = new StringBuilder(); bool isFull = string.IsNullOrEmpty(item.TrangQuangCao_Ten); sb.AppendFormat(@"<div class=""{0}""> {3}{2}{1} </div>", isFull ? "adv-item-chiTietBig1" : "adv-item-chiTietTiny1" , isFull ? "" : string.Format(@"<span class=""adv-item-mota"">{2}</span><a href=""{0}"" class=""adv-item-url"">{0}</a>", item.Url, item.Ten, item.TrangQuangCao_Ten) , string.IsNullOrEmpty(item.Anh) ? "" : string.Format(@"<a href=""{2}"" class=""adv-item-img-box""><img class=""adv-item-img"" src=""{0}lib/up/i/{1}""/></a>", domain, isFull ? item.Anh : Lib.imgSize(item.Anh, "100x100"), item.Url) , isFull ? "" : string.Format(@"<a class=""adv-item-ten"" href=""{0}"">{1}</a>", item.Url, item.Ten, item.TrangQuangCao_Ten) ); return(sb.ToString()); }
public static QuangCao SelectById(Int32 ADV_ID) { QuangCao Item = new QuangCao(); SqlParameter[] obj = new SqlParameter[1]; obj[0] = new SqlParameter("ADV_ID", ADV_ID); using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblQuangCao_Select_SelectById_linhnx", obj)) { while (rd.Read()) { Item = getFromReader(rd); } } return(Item); }
public static QuangCao UpdateHoangDA(QuangCao Updated) { QuangCao Item = new QuangCao(); SqlParameter[] obj = new SqlParameter[22]; obj[0] = new SqlParameter("ADV_ID", Updated.ID); obj[1] = new SqlParameter("ADV_Ten", Updated.Ten); obj[2] = new SqlParameter("ADV_Anh", Updated.Anh); obj[3] = new SqlParameter("ADV_Url", Updated.Url); obj[4] = new SqlParameter("ADV_ThuTu", Updated.ThuTu); obj[5] = new SqlParameter("ADV_RowId", Updated.RowId); obj[6] = new SqlParameter("ADV_TrangQuangCao", Updated.TrangQuangCao); obj[7] = new SqlParameter("ADV_TrangQuangCao_Ten", Updated.TrangQuangCao_Ten); obj[8] = new SqlParameter("ADV_ViTri", Updated.ViTri); obj[9] = new SqlParameter("ADV_ViTri_Ten", Updated.ViTri_Ten); obj[10] = new SqlParameter("ADV_Active", Updated.Active); obj[11] = new SqlParameter("ADV_NgayTao", Updated.NgayTao); obj[12] = new SqlParameter("ADV_NgayHetHan", Updated.NgayHetHan); obj[13] = new SqlParameter("ADV_NgayCapNhat", Updated.NgayCapNhat); obj[14] = new SqlParameter("ADV_NguoiTao", Updated.NguoiTao); obj[15] = new SqlParameter("ADV_NgayDangKy", Updated.NgayDangKy); obj[16] = new SqlParameter("ADV_TenDonVi", Updated.TenDonVi); obj[17] = new SqlParameter("ADV_DiaChiDonVi", Updated.DiaChiDonVi); obj[18] = new SqlParameter("ADV_NguoiLienHe", Updated.NguoiLienHe); obj[19] = new SqlParameter("ADV_Email", Updated.Email); obj[20] = new SqlParameter("ADV_DienThoai", Updated.DienThoai); obj[21] = new SqlParameter("ADV_SoTienThanhToan", Updated.SoTienThanhToan); using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblQuangCao_Update_UpdateNormal_hoangda", obj)) { while (rd.Read()) { Item = getFromReader(rd); } } return(Item); }
public static QuangCao Insert(QuangCao Inserted) { QuangCao Item = new QuangCao(); SqlParameter[] obj = new SqlParameter[9]; obj[0] = new SqlParameter("ADV_Ten", Inserted.Ten); obj[1] = new SqlParameter("ADV_Anh", Inserted.Anh); obj[2] = new SqlParameter("ADV_Url", Inserted.Url); obj[3] = new SqlParameter("ADV_ThuTu", Inserted.ThuTu); obj[4] = new SqlParameter("ADV_RowId", Inserted.RowId); obj[5] = new SqlParameter("ADV_Active", Inserted.Active); obj[6] = new SqlParameter("ADV_ViTri", Inserted.ViTri); obj[7] = new SqlParameter("ADV_ViTri_Ten", Inserted.ViTri_Ten); obj[8] = new SqlParameter("TrangQuangCao_Ten", Inserted.TrangQuangCao_Ten); using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblQuangCao_Insert_InsertNormal_linhnx", obj)) { while (rd.Read()) { Item = getFromReader(rd); } } return(Item); }
public static QuangCao getFromReader(IDataReader rd) { QuangCao Item = new QuangCao(); if (rd.FieldExists("ADV_ID")) { Item.ID = (Int32)(rd["ADV_ID"]); } if (rd.FieldExists("ADV_Ten")) { Item.Ten = (String)(rd["ADV_Ten"]); } if (rd.FieldExists("ADV_Anh")) { Item.Anh = (String)(rd["ADV_Anh"]); } if (rd.FieldExists("ADV_Url")) { Item.Url = (String)(rd["ADV_Url"]); } if (rd.FieldExists("ADV_ThuTu")) { Item.ThuTu = (Int32)(rd["ADV_ThuTu"]); } if (rd.FieldExists("ADV_RowId")) { Item.RowId = (Guid)(rd["ADV_RowId"]); } if (rd.FieldExists("ADV_TrangQuangCao")) { Item.TrangQuangCao = (Int32)(rd["ADV_TrangQuangCao"]); } if (rd.FieldExists("ADV_TrangQuangCao_Ten")) { Item.TrangQuangCao_Ten = (String)(rd["ADV_TrangQuangCao_Ten"]); } if (rd.FieldExists("ADV_ViTri")) { Item.ViTri = (Int32)(rd["ADV_ViTri"]); } if (rd.FieldExists("ADV_ViTri_Ten")) { Item.ViTri_Ten = (String)(rd["ADV_ViTri_Ten"]); } if (rd.FieldExists("ADV_Active")) { Item.Active = (Boolean)(rd["ADV_Active"]); } if (rd.FieldExists("ADV_NgayTao")) { Item.NgayTao = (DateTime)(rd["ADV_NgayTao"]); } if (rd.FieldExists("ADV_NgayHetHan")) { Item.NgayHetHan = (DateTime)(rd["ADV_NgayHetHan"]); } if (rd.FieldExists("ADV_NgayCapNhat")) { Item.NgayCapNhat = (DateTime)(rd["ADV_NgayCapNhat"]); } if (rd.FieldExists("ADV_NguoiTao")) { Item.NguoiTao = (String)(rd["ADV_NguoiTao"]); } if (rd.FieldExists("ADV_NgayDangKy")) { Item.NgayDangKy = (DateTime)(rd["ADV_NgayDangKy"]); } if (rd.FieldExists("ADV_TenDonVi")) { Item.TenDonVi = (String)(rd["ADV_TenDonVi"]); } if (rd.FieldExists("ADV_DiaChiDonVi")) { Item.DiaChiDonVi = (String)(rd["ADV_DiaChiDonVi"]); } if (rd.FieldExists("ADV_NguoiLienHe")) { Item.NguoiLienHe = (String)(rd["ADV_NguoiLienHe"]); } if (rd.FieldExists("ADV_Email")) { Item.Email = (String)(rd["ADV_Email"]); } if (rd.FieldExists("ADV_DienThoai")) { Item.DienThoai = (String)(rd["ADV_DienThoai"]); } if (rd.FieldExists("ADV_SoTienThanhToan")) { Item.SoTienThanhToan = (Double)(rd["ADV_SoTienThanhToan"]); } return(Item); }