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); }
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); }
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); }
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); }
public string getIconName(object o) { isExist = FavDAO.isItemExist(Session.SessionID, o.ToString()); if (isExist) { return("fav-active"); } else { return("fav-inactive"); } }
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"); } }
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); }
public static void clearFav(string sessionId) { FavDAO.clearFav(sessionId); }
public List <string> SelectUserFavs(string uid) { List <string> sids = new FavDAO().SelectUserFavs(uid); return(sids); }
public int Remove(int uid, int sid) { int result = new FavDAO().Remove(uid, sid); return(result); }
public int Add() { int result = new FavDAO().Insert(this); return(result); }