private List <AdvProductHotdeal> Get_List_Product_Insert(string KeySearch, int AdvIdCate, string MaHopDong, DateTime startDate, DateTime endDate) { DataTable tblProduct = new DataTable(); tblProduct = sqldbProduct.GetTblData(string.Format("select top 50 * from Product where Contains(Name,'{0}') and Company <> 6619858476258121218 and Valid = 1", KeySearch.Replace(" ", "*").Trim())); List <AdvProductHotdeal> lstProduct = new List <AdvProductHotdeal>(); foreach (DataRow row in tblProduct.Rows) { AdvProductHotdeal objProduct = new AdvProductHotdeal(); objProduct.AdvIdCate = AdvIdCate; objProduct.MerchantId = Common.Obj2Int64(row["Company"]); objProduct.MaHopDong = MaHopDong; objProduct.ProductId = Common.Obj2Int64(row["ID"]); objProduct.Name = Common.Obj2String(row["Name"]); objProduct.FilePath = string.Format("{0}{1}", "http://img.websosanh.vn/", Common.Obj2String(row["ImagePath"])); objProduct.StartDate = startDate; objProduct.EndDate = endDate; objProduct.Description = ""; objProduct.IsActive = true; objProduct.Linkwss = ""; objProduct.Link = Common.Obj2String(row["DetailUrl"]); objProduct.Price = Common.Obj2Int(row["Price"]); objProduct.PriceOld = Common.Obj2Int(row["Price"]); objProduct.Order = 100; objProduct.IsHot = false; lstProduct.Add(objProduct); } return(lstProduct); }
private void Insert_AdvProductHotdeal(AdvProductHotdeal objProduct) { sqldbLandingPage.RunQuery("CMS_LandingPageSeo_InsertProruct", CommandType.StoredProcedure, new System.Data.SqlClient.SqlParameter[] { SqlDb.CreateParamteterSQL("@AdvIdCate", (object)objProduct.AdvIdCate, SqlDbType.Int), SqlDb.CreateParamteterSQL("@MerchantId", (object)objProduct.MerchantId, SqlDbType.BigInt), SqlDb.CreateParamteterSQL("@MaHopDong", (object)objProduct.MaHopDong, SqlDbType.NVarChar), SqlDb.CreateParamteterSQL("@ProductId", (object)objProduct.ProductId, SqlDbType.BigInt), SqlDb.CreateParamteterSQL("@Name", (object)objProduct.Name, SqlDbType.NVarChar), SqlDb.CreateParamteterSQL("@FilePath", (object)objProduct.FilePath, SqlDbType.NVarChar), SqlDb.CreateParamteterSQL("@StartDate", (object)objProduct.StartDate, SqlDbType.DateTime), SqlDb.CreateParamteterSQL("@EndDate", (object)objProduct.EndDate, SqlDbType.DateTime), SqlDb.CreateParamteterSQL("@Description", (object)objProduct.Description, SqlDbType.NVarChar), SqlDb.CreateParamteterSQL("@IsActive", (object)objProduct.IsActive, SqlDbType.Bit), SqlDb.CreateParamteterSQL("@Linkwss", (object)objProduct.Linkwss, SqlDbType.NVarChar), SqlDb.CreateParamteterSQL("@Link", (object)objProduct.Link, SqlDbType.NVarChar), SqlDb.CreateParamteterSQL("@Price", (object)objProduct.Price, SqlDbType.Int), SqlDb.CreateParamteterSQL("@PriceOld", (object)objProduct.PriceOld, SqlDbType.Int), SqlDb.CreateParamteterSQL("@Order", (object)objProduct.Order, SqlDbType.Int), SqlDb.CreateParamteterSQL("@IsHot", (object)objProduct.IsHot, SqlDbType.Int) }); }