public ActionResult Delete_Goods(int Good_id) { GoodsManager gm = new GoodsManager(); gm.Detele_Goods(Good_id); return(RedirectToAction("Goodtable")); }
public ActionResult Add(Goods Info) { GoodsManager bll = new GoodsManager(); var result = bll.Add(Info); return(Json(result, JsonRequestBehavior.AllowGet)); }
public IHttpActionResult Add(Goods Info) { GoodsManager bll = new GoodsManager(); var result = bll.Add(Info); return(Json(result)); }
public IHttpActionResult Put(Goods info) { GoodsManager bll = new GoodsManager(); var result = bll.Update(info); return(Json(result)); }
public void Good_SaveAndRead() { GoodsManager gm = new GoodsManager(); Good good1 = new Good("A", 5, 2, 7); Tuple <bool, string> rtn = gm.AddNewGood(good1); Good good2 = new Good("B", 5, 2, 7); Tuple <bool, string> rtn2 = gm.AddNewGood(good2); string localPath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); string filename = Path.Combine(localPath, "Goods.json"); GoodsRepository repo = new GoodsRepository(); bool rtnSave = repo.SaveGoods(filename, gm.Goods); Assert.AreEqual(true, rtnSave); GoodsManager gm1 = new GoodsManager(); gm1.Goods = repo.ReadGoods(filename); Assert.AreEqual(2, gm1.GetNumberOfGoods()); Good g1 = gm1.SearchAGood("A"); Assert.AreEqual(good1.Item, g1.Item); Assert.AreEqual(good1.OfferItemNumber, g1.OfferItemNumber); Assert.AreEqual(good1.OfferPrice, g1.OfferPrice); Assert.AreEqual(good1.Price, g1.Price); }
public async Task <ActionResult> Delete(Guid id) { IBLL.IGoodsManager goodsManager = new GoodsManager(); await goodsManager.DeleteGoods(id); return(RedirectToAction("GoodsList")); }
//根据id删除 public ActionResult DelectId(Goods info1) { GoodsManager goods = new GoodsManager(); var lis = goods.Delete(info1.GoodsId); return(Json(lis, JsonRequestBehavior.AllowGet)); }
protected void btnRply_Click(object sender, EventArgs e) { if (Session["UserName"] != null) { if (Page.IsValid) { Button btn = (Button)sender; string a = ((TextBox)btn.Parent.FindControl("txtReplyContent")).Text.Trim(); ReplyMallComments replymallcomments = new ReplyMallComments(); replymallcomments.MallCommentsID = Int32.Parse((btn.Parent.FindControl("HiddenFieldComID") as HiddenField).Value); replymallcomments.UserID = int.Parse(Session["UserID"].ToString()); replymallcomments.ReplyContents = ((TextBox)btn.Parent.FindControl("txtReplyContent")).Text.Trim(); replymallcomments.ReplyTime = DateTime.Now; int result = GoodsManager.InsertReplyMallComments(replymallcomments); if (result >= 1) { ScriptManager.RegisterClientScriptBlock(UpP003, this.GetType(), "click", "alert('回复成功')", true); BindMallComments(); } else { ScriptManager.RegisterClientScriptBlock(UpP003, this.GetType(), "click", "alert('未知原因 回复失败')", true); } } } else { ScriptManager.RegisterClientScriptBlock(UpP003, this.GetType(), "click", "alert('请先登录');", true); } }
public void IsExistGoods() { var dics = new GoodsManager().GetGoodsSelectList("博士伦季抛"); //var info=GoodsManager.GetGoodsBaseInfoListByClassId(Guid.Empty, "瞳瑶蓝黑色彩色隐形眼镜-301"); Assert.IsTrue(dics != null && dics.Count > 0); }
public IHttpActionResult Delete(int id) { GoodsManager bll = new GoodsManager(); var result = bll.Delete(id); return(Json(result)); }
private void txtPurchase_PreviewKeyDown(object sender, KeyEventArgs e) { if ((e.Key >= Key.D0 && e.Key <= Key.D9) || (e.Key >= Key.NumPad0 && e.Key <= Key.NumPad9) || (e.Key >= Key.A && e.Key <= Key.Z) || e.Key == Key.Back) { e.Handled = false; } else { e.Handled = true; } if (e.Key == Key.Enter) { string keyWords = this.txtPurchase.Text; Goods goods = GoodsManager.GetGoods(keyWords); if (goods != null) { if (goods.SaleState == SaleState.Stop) { MessageBox.Show("该商品已停止销售!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning); this.txtPurchase.Clear(); return; } AddPurchase(goods); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindAllTotal(); BindShoppingCart(); } if (Session["UserName"] != null) { HadLogin.Visible = true; NotLogin.Visible = false; lbusername.InnerText = Session["UserName"].ToString(); } else { NotLogin.Visible = true; HadLogin.Visible = false; } int ID = Convert.ToInt32(Session["UserID"]); DataTable ys = GoodsManager.JudgeShoppingCart(ID); if (ys != null && ys.Rows.Count != 0) { Panel01.Visible = true; Panel02.Visible = false; } else { Panel01.Visible = false; Panel02.Visible = true; } BindUserMallCart(); }
public ActionResult Good_xiugai(string Gid, string id, HttpPostedFileBase file, HttpPostedFileBase file1, string Good_name, string Good_price, string Good_Cate, string Good_nums, string Good_text) { string file2, file3; GoodsManager gm = new GoodsManager(); int gid = Convert.ToInt32(id); var da = db.Goods.Where(o => o.Goods_id == gid).FirstOrDefault(); if (file != null) { file2 = Save_img(file, "/Img/Good_photo"); } else { file2 = da.Goods_photo; } da.Goods_photo = file2; if (file1 != null) { file3 = Save_img(file1, "/Img/Good_photo"); } else { file3 = da.Goods_intro; } da.Goods_intro = file3; da.Goods_name = Good_name; da.Goods_nums = Convert.ToInt32(Good_nums); da.Goods_price = Convert.ToInt32(Good_price); da.Good_intro_text = Good_text; da.Goods_cate = Convert.ToInt32(Good_Cate); db.SaveChanges(); int Gid1 = Convert.ToInt32(Gid); return(RedirectToAction("Good_List", new { Gid = Gid1 })); }
public ActionResult Test() { GoodsManager bll = new GoodsManager(); var list = bll.GetAll(); return(View(list)); }
public void GetGoodsListByGoodsNameOrGoodsCode() { //var info = GoodsManager.GetGoodsBaseInfoByGoodsCode("3535335"); //var list = GoodsManager.GetRealGoodsIdListByGoodsNameOrCode("迷卡倾城灰彩色隐形眼镜半年抛一片装"); var list = new GoodsManager().GetGoodsSelectList("MK06184"); Assert.IsTrue(list != null && list.Count > 0); }
// GET: Home public ActionResult Index() { GoodsManager bll = new GoodsManager(); var list = bll.GetAll(); // return Redirect("/Admin/Account/Index"); return(View(list)); }
private void BindgzBooks() { DataTable dt = GoodsManager.SelectgzBooksTop6(); if (dt != null && dt.Rows.Count != 0) { RPgzpaihang.DataSource = dt; RPgzpaihang.DataBind(); } }
public void AddNewGood_NoValues() { GoodsManager gm = new GoodsManager(); Good good = new Good(); Tuple <bool, string> rtn = gm.AddNewGood(good); Assert.AreEqual(false, rtn.Item1); Assert.AreEqual(gm.GoodIsNotValid, rtn.Item2); }
public void BindAllBooks() { DataTable dt = GoodsManager.SelectAllBooks(); if (dt != null && dt.Rows.Count != 0) { LVBooks.DataSource = dt; LVBooks.DataBind(); } }
public void BindgzVideo() { DataTable dt = GoodsManager.SelectgzVideo(); if (dt != null && dt.Rows.Count != 0) { LVgzVideo.DataSource = dt; LVgzVideo.DataBind(); } }
public void AddNewGood_WithValues() { GoodsManager gm = new GoodsManager(); Good good = new Good("A", 5); Tuple <bool, string> rtn = gm.AddNewGood(good); Assert.AreEqual(true, rtn.Item1); Assert.AreEqual("", rtn.Item2); }
public void AddNewGood_RightOfferCount() { GoodsManager gm = new GoodsManager(); Good good = new Good("A", 5, 2, 7); Tuple <bool, string> rtn = gm.AddNewGood(good); Assert.AreEqual(1, gm.GetNumberOfGoods()); Assert.AreEqual(1, gm.GetNumberOfGoodsInOffer()); }
private void DestroyEvent() { GlobalEventHandle.GetDiamondHandle -= new Action <int, bool>(this.OnGetDiamond); GlobalEventHandle.ConsumeDiamondHandle -= new Action <int>(this.OnConsumeGEM); GlobalEventHandle.AddExpHandle -= new Action <bool>(this.OnAddExp); GlobalEventHandle.DoClickBottom -= new Action(this.OnDoClickBottomButton); GlobalEventHandle.DoUseProps -= new Action <bool, List <GameObject> >(this.OnDoUseProps); GlobalEventHandle.AdsHandle -= new Action <string, bool>(this.OnRefreshAdsTimer); GoodsManager.GetInstance().ShowSubscriptionHanle -= new Action <int, int>(this.ShowSubscriptionAwards); }
protected void BindShoppingCart() { string UserID = Convert.ToString(Session["UserName"]); DataTable dt = GoodsManager.SelectShoppingCart(UserID); if (dt != null && dt.Rows.Count != 0) { LVShoppingcart.DataSource = dt; LVShoppingcart.DataBind(); } }
public ActionResult CreateGood(CreateGoodViewModel model) { if (ModelState.IsValid) { IBLL.IGoodsManager goodsManager = new GoodsManager(); goodsManager.AddGoods(model.Name, model.ImgsUrl, model.Price, model.PriceOld); return(RedirectToAction("GoodsList")); } ModelState.AddModelError("", "您录入的信息有误"); return(View(model)); }
//获取车辆商品 public void BindGoods() { int id = int.Parse(Request.QueryString["id"]); DataTable dt = GoodsManager.SelectStoreID(id, 1); if (dt != null && dt.Rows.Count > 0) { LVgoods.DataSource = dt; LVgoods.DataBind(); } }
public void AddNewGood_Search() { GoodsManager gm = new GoodsManager(); Good good1 = new Good("A", 5, 2, 7); Tuple <bool, string> rtn = gm.AddNewGood(good1); Good good2 = new Good("B", 5, 2, 7); Tuple <bool, string> rtn2 = gm.AddNewGood(good2); Assert.AreEqual(good1, gm.SearchAGood("A")); }
protected void getindent() { int userid = (int)Session["user_id"]; DataTable dts = GoodsManager.SelectIndent(userid); if (dts != null && dts.Rows.Count != 0) { indents.DataSource = dts; indents.DataBind(); } }
public void BindShoppingCart() { int id = Convert.ToInt32(Session["user_id"]); DataTable dt = GoodsManager.SelectShoppingCart(id); if (dt != null && dt.Rows.Count > 0) { Reshoppingcart.DataSource = dt; Reshoppingcart.DataBind(); } }
public IHttpActionResult Get() { GoodsManager bll = new GoodsManager(); var list = bll.GetAll(); var list1 = list.Select(x => new { x.GoodsId, x.GoodsName, x.Goods_Type.TypeName }); return(Json(list1)); }