示例#1
0
        public static int toggleFav(string sku, string sessionID, string userID)
        {
            Dictionary <string, string> dic = new Dictionary <string, string>();

            Logger.Info("AjaxService ########################  sku :" + sku + " sessionID : " + sessionID + " userID : " + userID);
            int count = FavDAO.toggleFav(sku, sessionID, userID);

            Logger.Info("AjaxService ########################  count :" + count);
            // DataTable dt = new DataTable(); GenericService.getVewImageNewMasterDT();
            //IEnumerable<DataRow> query =
            //from dr in dt.AsEnumerable()
            //    where dr.Field<String>("SKUCode") == sku
            //select dr;
            //try{
            // dt = query.CopyToDataTable<DataRow>();
            //}catch(Exception e){Logger.Info("AjaxService ########################  exception :"+e);}
            //Logger.Info("AjaxService ########################  dt :"+dt.Rows.Count);
            //if(!CommonUtil.DT.isEmptyOrNull(dt)){
            //    dic.Add("brand",dt.Rows[0]["SKUBrand"]+"");
            //    dic.Add("sku",dt.Rows[0]["SKUCode"]+"");
            //    dic.Add("name",dt.Rows[0]["SKUName"]+"");
            //    dic.Add("mrp",dt.Rows[0]["MRP"]+"");
            //    dic.Add("price",dt.Rows[0]["SpecialPrice"]+"");
            //    dic.Add("image",dt.Rows[0]["PathInternaldetailsSmallImage"]+"");
            //}
            return(count);
        }
示例#2
0
        public static Dictionary <string, string> addFav(string sku, string sessionID, string userID)
        {
            Dictionary <string, string> dic = new Dictionary <string, string>();

            int count = FavDAO.addFav(sku, sessionID, userID);

            if (count > 0)
            {
                DataTable             dt    = GenericService.getVewImageNewMasterDT();
                IEnumerable <DataRow> query =
                    from dr in dt.AsEnumerable()
                    where dr.Field <String>("SKUCode") == sku
                    select dr;
                try{
                    dt = query.CopyToDataTable <DataRow>();
                }catch {}

                if (!CommonUtil.DT.isEmptyOrNull(dt))
                {
                    dic.Add("brand", dt.Rows[0]["SKUBrand"] + "");
                    dic.Add("sku", dt.Rows[0]["SKUCode"] + "");
                    dic.Add("name", dt.Rows[0]["SKUName"] + "");
                    dic.Add("mrp", dt.Rows[0]["MRP"] + "");
                    dic.Add("price", dt.Rows[0]["SpecialPrice"] + "");
                    dic.Add("image", dt.Rows[0]["PathInternaldetailsSmallImage"] + "");
                }
            }
            return(dic);
        }
示例#3
0
 private void updateSessionIdInTable()
 {
     CartDAO.updateCart(Session[Constant.Session.LOGED_IN_USER_ID] + "", Session.SessionID);
     FavDAO.updateFavList(Session[Constant.Session.LOGED_IN_USER_ID] + "", Session.SessionID);
     Session.Remove(Constant.Session.CART_ITEMS);
     Session.Remove(Constant.Session.FAV_LIST);
     Session.Remove(Constant.Session.TOTAL);
 }
示例#4
0
 private void removeFromWL()
 {
     FavDAO.removeFromWL(Session.SessionID, Request.Params["sku"]);
     Session.Remove(Constant.Session.FAV_LIST);
     Server.Transfer("ReloadWL.aspx");
     //Dictionary<string, string> dic = new Dictionary<string, string>();
     //dic.Add("success", "success");
     //sendResponse(dic);
 }
示例#5
0
 public string getIconName(object o)
 {
     isExist = FavDAO.isItemExist(Session.SessionID, o.ToString());
     if (isExist)
     {
         return("fav-active");
     }
     else
     {
         return("fav-inactive");
     }
 }
示例#6
0
    public string getToolTip()
    {
        bool isExist = FavDAO.isItemExist(Session.SessionID, dt.Rows[0]["SKUCode"] + "");

        if (isExist)
        {
            return("Remove From Wish-List");
        }
        else
        {
            return("Add to Wish list");
        }
    }
示例#7
0
        public static DataTable getFavDT(string sessionId)
        {
            DataTable dt1 = new DataTable();

            if (HttpContext.Current.Session[Constant.Session.FAV_LIST] != null)
            {
                dt1 = HttpContext.Current.Session[Constant.Session.FAV_LIST] as DataTable;
            }
            else
            {
                dt1 = FavDAO.getFavDT(sessionId);
                if (!CommonUtil.DT.isEmptyOrNull(dt1))
                {
                    DataTable dt    = GenericService.getVewImageNewMasterDT();
                    DataTable dummy = dt.Clone();
                    dummy.Clear();
                    for (int i = 0; i < dt1.Rows.Count; i++)
                    {
                        IEnumerable <DataRow> query =
                            from dr in dt.AsEnumerable()
                            where dr.Field <String>("SKUCode") == dt1.Rows[i]["SKU"] + ""
                            select dr;
                        try
                        {
                            dummy.ImportRow(query.CopyToDataTable <DataRow>().Rows[0]);
                        }
                        catch (InvalidOperationException e)
                        {
                            Logger.Error("Exception occur HomeService.getMenuDT()", e);
                            dt1 = new DataTable();
                        }
                    }
                    HttpContext.Current.Session[Constant.Session.FAV_LIST] = dummy;
                    dt1 = dummy;
                }
            }
            return(dt1);
        }
示例#8
0
 public static void clearFav(string sessionId)
 {
     FavDAO.clearFav(sessionId);
 }
示例#9
0
        public List <string> SelectUserFavs(string uid)
        {
            List <string> sids = new FavDAO().SelectUserFavs(uid);

            return(sids);
        }
示例#10
0
        public int Remove(int uid, int sid)
        {
            int result = new FavDAO().Remove(uid, sid);

            return(result);
        }
示例#11
0
        public int Add()
        {
            int result = new FavDAO().Insert(this);

            return(result);
        }