/// <summary> /// 添加产品 /// </summary> /// <returns></returns> public ActionResult Add_Goods() { if (Request["GoodName"] != null && Request["GoodName"].ToString() != "") { Model.Good add_Good = new Model.Good(); add_Good.GoodsName = Request["GoodName"].ToString(); add_Good.GoodsPic = Request["xFilePath"].ToString(); add_Good.ProductsSortID = Convert.ToInt32(Request["ProductsSort"]); add_Good.GoodsSortID = Convert.ToInt32(Request["GoodSort"]); add_Good.SalePrice = Convert.ToDecimal(Request["saleprice"]); add_Good.RentPrice = Convert.ToDecimal(Request["rentprice"]); add_Good.GoodsBrife = Request["GoodBrife"].ToString(); int ok = OperateContext.Current.BLLSession.IGoodBLL.Add(add_Good); if (ok == 1) { return(Content("ok")); } else { return(Content("Error")); } } else { return(Content("Error")); } }
public ActionResult ModifyGoodsSupplies(Model.ViewModel.GoodsList g) { Model.Good modify_g = new Model.Good(); modify_g.GoodsID = g.GoodsID; modify_g.Supplies = g.Supplies; int ok = OperateContext.Current.BLLSession.IGoodBLL.Modify(modify_g, new string[] { "Supplies" }); if (ok == 1) { return(Content("Ok modify Supplies!")); } else { return(Content("Error modify Supplies!")); } }
public ActionResult ModifyGoods(Model.ViewModel.GoodsList g) { Model.Good modify_g = new Model.Good(); modify_g.GoodsID = g.GoodsID; modify_g.GoodsName = g.GoodsName; modify_g.GoodsPic = g.GoodsPic; modify_g.GoodsBrife = g.GoodsBrife; modify_g.GoodsSortID = g.GoodsSortID; modify_g.ProductsSortID = g.ProductsSortID; modify_g.SalePrice = Convert.ToDecimal(g.SalePrice); modify_g.RentPrice = Convert.ToDecimal(g.RentPrice); int ok = OperateContext.Current.BLLSession.IGoodBLL.Modify(modify_g, new string[] { "GoodsName", "RentPrice", "SalePrice", "GoodsSortID", "ProductsSortID", "GoodsPic", "GoodsBrife" }); if (ok == 1) { return(Content("Ok modify!")); } else { return(Content("Error modify!")); } }