public bool AddShopMSG(Tshop model) { var NowTime = DateTime.Now; model.ShopSetTime = NowTime; return(bendshopDal.AddShopMSG(model)); }
public bool Add_shopvule(Tshop model) { shopmaney.ID = 1; int monmey = Convert.ToInt32(model.ShopValue); var AllMoneymodel = _bendmoneyBll.Scan_AllMoney(); shopmaney.AllMoney = AllMoneymodel[0].AllMoney + monmey; return(TAllmoneylDal.Add_buyshop(shopmaney)); }
public ActionResult Update_ShopMSG(Tshop model) { var result = false; int Id = model.ID; var result1 = TAllmoneylBll.delet_buyshop(Id);//先减去原来的价值 result = _bendshopBll.Update_ShopMSG(model); var result2 = TAllmoneylBll.Add_shopvule(model);//添加更新后的价值 var result3 = TAllmoneylBll.all_buyshop(); return(RedirectToAction("BendShopIndex", "BendShop")); }
public ActionResult AddShopMSG() { Tshop tshopMolde = new Tshop(); NameValueCollection nvc = System.Web.HttpContext.Current.Request.Form; HttpFileCollection hfc = System.Web.HttpContext.Current.Request.Files; string imgPath = ""; if (hfc[0].FileName == "") { return(View("ItemsCollectionIndex")); } else { //if (hfc.Count > 0) //{ imgPath = "/DataImg/shop/" + hfc[0].FileName; string PhysicalPath = Server.MapPath(imgPath); hfc[0].SaveAs(PhysicalPath); //} tshopMolde.Scrimg = imgPath; tshopMolde.ShopArea = nvc.Get("ShopArea"); tshopMolde.ShopCharityIdcard = nvc.Get("ShopCharityIdcard"); tshopMolde.ShopCharityName = nvc.Get("ShopCharityName"); tshopMolde.ShopCharityPhone = nvc.Get("ShopCharityPhone"); tshopMolde.ShopCharityWay = nvc.Get("ShopCharityWay"); tshopMolde.ShopName = nvc.Get("ShopName"); tshopMolde.ShopRemark = nvc.Get("ShopRemark"); tshopMolde.ShopSale = nvc.Get("ShopSale"); tshopMolde.ShopValue = nvc.Get("ShopValue"); if (tshopMolde.ShopName == "") { return(RedirectToAction("ItemsCollectionIndex", "ItemsCollection")); } else { var result = false; result = _bendshopBll.AddShopMSG(tshopMolde); var result1 = TAllmoneylBll.Add_shopvule(tshopMolde); ///商品进行添加时对总物品价值进行添加 var result2 = TAllmoneylBll.all_buyshop(); ///商品进行添加时对总价值资金发生改变 return(RedirectToAction("MarketIndex", "Market")); } } }
public bool AddShopMSG(Tshop model) { var result = false; const string AddShopMSGsql = @" INSERT INTO dbo.Tshop ( ShopName, ShopValue, ShopSale, ShopArea, ShopCharityName, ShopCharityPhone, ShopCharityWay, ShopCharityIdcard, ShopSetTime, Scrimg, ShopRemark ) VALUES ( @ShopName, @ShopValue, @ShopSale, @ShopArea, @ShopCharityName, @ShopCharityPhone, @ShopCharityWay, @ShopCharityIdcard, @ShopSetTime, @Scrimg, @ShopRemark )"; try { using (DbConnection conn = DbFactory.CreateConnection()) { result = conn.Execute(AddShopMSGsql, model) > 0; return(result); } } catch (System.Exception ex) { throw; } }
public bool Update_ShopMSG(Tshop model) { const string Update_ShopMSGsql = @" UPDATE dbo.Tshop SET ShopName =@ShopName, ShopValue =@ShopValue, ShopSale =@ShopSale, ShopArea =@ShopArea, ShopCharityName =@ShopCharityName, ShopCharityPhone =@ShopCharityPhone, ShopCharityWay =@ShopCharityWay, ShopCharityIdcard =@ShopCharityIdcard, ShopSetTime =@ShopSetTime, ShopRemark =@ShopRemark WHERE ID=@ID" ; using (DbConnection conn = DbFactory.CreateConnection()) { var result = conn.Execute(Update_ShopMSGsql, model) > 0; return(result); } }
public bool Update_ShopMSG(Tshop model) { return(bendshopDal.Update_ShopMSG(model)); }