public enum myLoginState { UNLOGIN = 0, LOGINSUSCCESS = 1, LOGINFAILED = 2, LOGINED=3 };//0未登录\1已登录\2登录失败\3已经登录 #region 更新用户信息 //更新所有信息 public int UpdateUser(int intUID, string strPass, string strEmail, string strPhone, string strTel, string strAddress, string strIP) { userInfo.Pass = strPass; userInfo.Email = strEmail; userInfo.Phone = strPhone; userInfo.Tel = strTel; userInfo.Address = strAddress; userInfo.IP = strIP; return(sqlHelper.ExcuteCommandInt("update [User] set Pass='******',Email='" + strEmail + "',Phone='" + strPhone + "',Tel='" + strTel + "',Address='" + strAddress + "' where UID=" + intUID + "")); }
////新增图片 //public bool InserItemsPic(int ItemID,string BigImg,string SmallImg,string Alt) { // if (sqlHelper.ExcuteCommandInt("insert into Images(ItemID,BigImg,SmallImg,Alt) values (" // +ItemID+",'"+BigImg+"','"+SmallImg+"','"+Alt+"')") > 0) // return true; // else // return false; //} public bool InserItemsPic(Entity.PicturesItem picture) { if (sqlHelper.ExcuteCommandInt("insert into Images(ItemID,BigImg,SmallImg,Alt) values (" + picture.getItemID() + ",'" + picture.getBigImg() + "','" + picture.getSmallImg() + "','" + picture.getAlt() + "')") > 0) { return(true); } else { return(false); } }
//新增 //public bool AddProduct(int CategoryID,string Name,string Description) { // if (helper.ExcuteCommandInt("insert into Products(CategoryID,Name,Description) values("+CategoryID+",'"+Name+"','"+Description+"')") > 0) // return true; // else // return false; //} public bool AddProduct(Entity.Products product) { //int CategoryID, string Name, string Description if (helper.ExcuteCommandInt("insert into Products(CategoryID,Name,Description) values(" + product.getCategoryID() + ",'" + product.getName() + "','" + product.getDescription() + "')") > 0) { return(true); } else { return(false); } }
//加入购物车 public bool Buy(int ItemID, int UserID) { string sql = ""; if (isExist(ItemID, UserID)) { sql = "update MyCar set Count=Count+1 where ItemID=" + ItemID + " and UserID=" + UserID + ""; } else { sql = "insert into MyCar(ItemID,UserID,IsPay,AddDate) values (" + ItemID + "," + UserID + ",'false','" + DateTime.Now.ToString() + "') "; } // new BLL.Items().BuyTimesAdd(ItemID);//购买次数自增 return(sql == "" ? false : helper.ExcuteCommandInt(sql) > 0); }
public bool addLogView(Entity.ViewLog viewLog) { return(helper.ExcuteCommandInt("insert into ViewLogs(VItemID,VUserID,VLocationX,VLocationY,VDate,VisHidden) values(" + viewLog.getVItemID() + "," + viewLog.getVUserID() + ",'" + viewLog.getVLocationX() + "','" + viewLog.getVLocationY() + "','" + viewLog.getVDate() + "','" + viewLog.isVisHidden() + "')") > 0); }
public bool addLogLogin(Entity.LoginLog loginLog) { if (helper.ExcuteCommandInt("insert into LoginLog(LUserID,LLocationX,LLocationY,LDate,LisHidden) values(" + loginLog.getLUserID() + ",'" + loginLog.getLLocationX() + "','" + loginLog.getLLocationY() + "','" + loginLog.getLDate() + "','" + loginLog.isLisHidden() + "');") > 0) { return(true); } else { return(false); } }
////新增(不知道有没有调用?) ////public bool AddItems(string Name, string AgoraPrice, string MemberPrice, string VipPrice, string SeckillPrice, string Area, string Details, string Days, string Hours, string Minutes, string Seconds) ////{ //// //ProductID,BrandID,Name,AgoraPrice,MemberPrice,VipPrice,SeckillPrice,Area,Details,IsSecondKill,LimitTime //// if (helper.ExcuteCommandInt("insert into Items(Name,AgoraPrice,MemberPrice,VipPrice,SeckillPrice,Area,Details,Days,Hours,Minutes,Seconds) values ('" //// + Name + "','" + AgoraPrice + "','" + MemberPrice + "','" + VipPrice + "','" + SeckillPrice + "','" + Area + "','" + Details + "','" + Days + "','" + Hours + "','" + Minutes + "','" + Seconds + "')") > 0) //// return true; //// else //// return false; ////} //public bool AddItems(Entity.Items items) { // return helper.ExcuteCommandInt("insert into Items(Name,AgoraPrice,MemberPrice,VipPrice,SeckillPrice,Area,Details,Days,Hours,Minutes,Seconds) values ('" // + items.getName() + "','" // + items.getAgoraPrice() + "','" // + items.getMemberPrice() + "','" // + items.getVipPrice()+ "','" // + items.getSeckillPrice()+ "','" // + items.getArea() + "','" // + items.getDetails() + "','" // + items.getDays() + "','" // + items.getHours()+ "','" // + items.getMinutes() + "','" // + items.getSeconds()+ "')") > 0; //} //新增 public bool AddItemsInfo(Entity.Items items) { //ProductID,BrandID,Name,AgoraPrice,MemberPrice,VipPrice,SeckillPrice,Area,Details,IsSecondKill,LimitTime return(helper.ExcuteCommandInt("insert into Items(ProductID,BrandID,Name,AgoraPrice,MemberPrice,VipPrice,SeckillPrice,Area,Details,Days,Hours,Minutes,Seconds) values (" + items.getProductID() + "," + items.getBrandID() + ",'" + items.getName() + "','" + items.getAgoraPrice() + "','" + items.getMemberPrice() + "','" + items.getVipPrice() + "','" + items.getSeckillPrice() + "','" + items.getArea() + "','" + items.getDetails() + "','" + items.getDays() + "','" + items.getHours() + "','" + items.getMinutes() + "','" + items.getSeconds() + "')") > 0); }
//新增 public bool InsertCategory(string sCName, string sDescription) { return(helper.ExcuteCommandInt("insert into Category(CName,Description) values ('" + sCName + "','" + sDescription + "')") > 0); }
//查找分类名是否存在 public int CmpClass(string strCName) { return(helper.ExcuteCommandInt("select ClassName from ArticleClass where ArticleClass='" + strCName + "'")); }