public bool EditStatusHotprice(int HotFeaProductID, string EditStatus, string EditHotprice) { var svHotFeat = new HotFeaProductService(); int it = svHotFeat.CountData <view_HotFeaProduct>(" * ", "HotFeaProductID = " + HotFeaProductID); if (EditStatus != null) { UpdateByCondition <view_HotFeaProduct>(" Status = N'" + EditStatus + "'", " HotFeaProductID = " + HotFeaProductID); IsResult = true; } else { IsResult = false; } if (EditHotprice != null) { UpdateByCondition <view_HotFeaProduct>(" Hotprice = " + Convert.ToDecimal(EditHotprice), " HotFeaProductID = " + HotFeaProductID); IsResult = true; } else { IsResult = false; } return(IsResult); }
public bool EditExpiredDate(int HotFeaProductID, int NumMonth) { if (NumMonth > 0 && NumMonth <= 12) { var svHotFeat = new HotFeaProductService(); int it = svHotFeat.CountData <view_HotFeaProduct>(" * ", "HotFeaProductID = " + HotFeaProductID + " AND ExpiredDate < GetDate() "); if (it > 0) { UpdateByCondition <view_HotFeaProduct>(" ExpiredDate = DATEADD(month," + NumMonth + ",getdate()) , PackageCount = PackageCount + 1 ", " HotFeaProductID = " + HotFeaProductID); IsResult = true; } else { UpdateByCondition <view_HotFeaProduct>(" ExpiredDate = DATEADD(month," + NumMonth + ",ExpiredDate) , PackageCount = PackageCount + 1 ", " HotFeaProductID = " + HotFeaProductID); IsResult = true; } } else { IsResult = false; MsgError.Add(new Exception(" Invalid month number. ")); } return(IsResult); }