/// <summary> /// ตรวจสอบ ว่า สินค้าของ user เต็ม หรือไม่ /// </summary> /// <param name="data"></param> /// <returns></returns> #endregion #region ValidateUpdate /// <summary> /// /// </summary> /// <param name="data"></param> /// <returns></returns> #endregion #endregion #region Method Select #region GetProduct #region Generate SQLWhere public string CreateWhereAction(FavAction action, int?CompID = 0) { var sqlWhere = string.Empty; #region Condition if (action == FavAction.All) { sqlWhere = "( IsDelete = 0 ) "; } else if (action == FavAction.IsFav) { //comprowflag มาจาก b2bcompany.rowflag sqlWhere = "( IsDelete = 0 AND RowFlag=1 AND CompRowFlag IN (2,4))"; } else if (action == FavAction.NotFav) { sqlWhere = "( IsDelete = 0 AND RowFlag=-1)) "; } if (CompID > 0) { sqlWhere += "AND (CompID = " + CompID + ")"; } #endregion return(sqlWhere); }
public void FavParser_FavTest(string page, FavAction action) { //Arrange const string expected = "/fav/40974349/?key=573cb7b373ed5090a3aa89a38c5e01fe4344cd65"; var parser = new FavResponseParser(action); var text = File.ReadAllText(page); //Act var actual = parser.Parse(text); //Assert Assert.Equal(expected, actual); }
public void FavParser_UnFavTest(string page, FavAction action) { //Arrange const string expected = "/unfav/40974349/?key=33507e398a5a3f4755f7cb575a8c98af6e433a6a"; var parser = new FavResponseParser(action); var text = File.ReadAllText(page); //Act var actual = parser.Parse(text); //Assert Assert.Equal(expected, actual); }
public FavResponseParser(FavAction favAction) { _favAction = favAction; }