public ActionResult AddFavBuylead(List <int> BuyId)
        {
            var           svFavBuylead = new FavBuyleadService();
            b2bFavBuylead model        = new b2bFavBuylead();

            try
            {
                #region Set svFavBuylead Model
                foreach (var Buy in BuyId)
                {
                    var IsResult = svFavBuylead.InsertFavBuylead(Buy, LogonCompID);
                    if (BuyId.Count() == 1)
                    {
                        return(Json(IsResult));
                    }
                }

                #endregion
            }
            catch (Exception ex)
            {
                CreateLogFiles(ex);
            }


            return(Json(new { IsResult = svFavBuylead.IsResult, MsgError = GenerateMsgError(svFavBuylead.MsgError), ID = model.FavoriteBuyleadID }));
        }
 public FavoriteController()
 {
     svFavProduct = new FavProductService();
     svFavBuylead = new FavBuyleadService();
     svFavCompany = new FavCompanyService();
     svBizType    = new BizTypeService();
     svCompany    = new CompanyService();
     svAddress    = new AddressService();
 }
        public ActionResult GetBuyleadName(string query)
        {
            svFavBuylead = new FavBuyleadService();

            sqlWhere  = svFavBuylead.CreateWhereAction(FavAction.IsFav, 0);
            sqlWhere += svFavBuylead.CreateWhereCause(0, query, 0, 0, 0, 0, 0, 0, 0);

            var FavBuyleads = svFavBuylead.SelectData <view_FavBuyLead>("BuyleadName", sqlWhere, "BuyleadName");
            var BuyleadName = FavBuyleads.Select(it => it.BuyleadName).ToList();

            return(Json(BuyleadName));
        }
        public ActionResult DeleteFavBuylead(List <int> BuyleadID)
        {
            var svFavBuylead = new FavBuyleadService();

            try
            {
                svFavBuylead.Delete(BuyleadID, LogonCompID);
            }
            catch (Exception ex)
            {
                svFavBuylead.MsgError.Add(ex);
                CreateLogFiles(ex);
            }
            return(Json(new { IsResult = svFavBuylead.IsResult, MsgError = GenerateMsgError(svFavBuylead.MsgError) }));
        }