/// <summary> /// 修改保存 /// </summary> /// <returns></returns> public ActionResult CaiJiaBianJiaXiuGaiBaoCun() { string styMy = "fail"; try { B_GoodsBianJiaList KK = new B_GoodsBianJiaList(); KK.GoodsBianJiaID = Convert.ToInt32(Request.Form["GoodsBianJiaID"]); KK.BianJiaBianHao = Request.Form["BianJiaBianHao"]; KK.BeginChangeData = Convert.ToDateTime(Request.Form["BeginChangeData"]); KK.ChangeWhyID = Convert.ToInt32(Request.Form["ChangeWhyID"]); //KK.GoodsDetailID = Convert.ToInt32(Request.Form["GoodsDetailID"]); //KK.NewAdvanceBid = Convert.ToDateTime(Request.Form["NewAdvanceBid"]); //KK.NewNoAdvanceBid = Convert.ToDateTime(Request.Form["NewNoAdvanceBid"]); KK.Registrant = Request.Form["Registrant"]; KK.RegisterTime = Convert.ToDateTime(Request.Form["RegisterTime"]); KK.Auditor = Request.Form["Auditor"]; KK.Checktime = Convert.ToDateTime(Request.Form["Checktime"]); KK.Executor = Request.Form["Executor"]; KK.ExecuteTime = Convert.ToDateTime(Request.Form["ExecuteTime"]); MyModels.Entry(KK).State = System.Data.Entity.EntityState.Modified; MyModels.SaveChanges(); styMy = "success"; } catch (Exception e) { Console.WriteLine(e); } return(Json(styMy, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 新增售价变价 /// </summary> /// <returns></returns> public ActionResult XinZengShouJiaBianJia() { B_GoodsBianJiaList QQ = new B_GoodsBianJiaList(); QQ.BianJiaBianHao = Request.Form["BianJiaBianHao"]; QQ.ChangeTypeID = Convert.ToInt32(Request.Form["ChangeTypeID"]); QQ.ChangeWhyID = Convert.ToInt32(Request.Form["ChangeWhyID"]); QQ.ChangeData = Convert.ToDateTime(Request.Form["ChangeData"]); //QQ.GoodsDetailID = Convert.ToInt32(Request.Form["GoodsDetailID"]); //QQ.NewAdvanceBid = Convert.ToDecimal(Request.Form["NewAdvanceBid"]); //QQ.NewNoAdvanceBid = Convert.ToDecimal(Request.Form["NewNoAdvanceBid"]); QQ.Registrant = Request.Form["Registrant"]; QQ.RegisterTime = Convert.ToDateTime(Request.Form["RegisterTime"]); QQ.Auditor = Request.Form["Auditor"]; QQ.Checktime = Convert.ToDateTime(Request.Form["Checktime"]); QQ.Executor = Request.Form["Executor"]; QQ.ExecuteTime = Convert.ToDateTime(Request.Form["ExecuteTime"]); if (QQ.BianJiaBianHao != null && QQ.ChangeTypeID != null && QQ.ChangeWhyID != null && QQ.ChangeData != null && QQ.Registrant != null && QQ.RegisterTime != null && QQ.Auditor != null && QQ.Checktime != null && QQ.Executor != null && QQ.ExecuteTime != null) { MyModels.B_GoodsBianJiaList.Add(QQ); MyModels.SaveChanges(); return(Json("success", JsonRequestBehavior.AllowGet)); } else { return(Json("fail", JsonRequestBehavior.AllowGet)); } }
/// <summary> /// 新增采购价变价 /// </summary> /// <returns></returns> public ActionResult XinZengCaiGouJiaBianJia(B_GoodsBianJiaList pwGoodsBianJia) { string strMsg = "fali"; try { //判断数据是否已经存在 int oldGoodsMoneyRuleRows = (from tbGoodsMoneyRule in MyModels.B_GoodsBianJiaList where tbGoodsMoneyRule.BianJiaBianHao == pwGoodsBianJia.BianJiaBianHao select tbGoodsMoneyRule).Count(); if (oldGoodsMoneyRuleRows == 0) { B_GoodsBianJiaList QQ = new B_GoodsBianJiaList(); QQ.BianJiaBianHao = Request.Form["BianJiaBianHao"]; QQ.BeginChangeData = Convert.ToDateTime(Request.Form["BeginChangeData"]); QQ.ChangeWhyID = Convert.ToInt32(Request.Form["ChangeWhyID"]); //QQ.GoodsDetailID = Convert.ToInt32(Request.Form["GoodsDetailID"]); //QQ.NewAdvanceBid = Convert.ToDecimal(Request.Form["NewAdvanceBid"]); //QQ.NewNoAdvanceBid = Convert.ToDecimal(Request.Form["NewNoAdvanceBid"]); QQ.Registrant = Request.Form["Registrant"]; QQ.RegisterTime = Convert.ToDateTime(Request.Form["RegisterTime"]); QQ.Auditor = Request.Form["Auditor"]; QQ.Checktime = Convert.ToDateTime(Request.Form["Checktime"]); QQ.Executor = Request.Form["Executor"]; QQ.ExecuteTime = Convert.ToDateTime(Request.Form["ExecuteTime"]); if (QQ.BianJiaBianHao != null && QQ.BeginChangeData != null && QQ.ChangeWhyID != null && QQ.Registrant != null && QQ.RegisterTime != null && QQ.Auditor != null && QQ.Checktime != null && QQ.Executor != null && QQ.ExecuteTime != null) { MyModels.B_GoodsBianJiaList.Add(QQ); MyModels.SaveChanges(); return(Json("success", JsonRequestBehavior.AllowGet)); } else { return(Json("fail", JsonRequestBehavior.AllowGet)); } } else { strMsg = "exsit"; } } catch (Exception e) { Console.WriteLine(e); } return(Json(strMsg, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 记录编号 /// </summary> /// <returns></returns> public ActionResult SelectBianJiaBianHao() { string strOrderNumber = ""; var listDep = (from tbDmp in MyModels.B_GoodsBianJiaList orderby tbDmp.BianJiaBianHao select tbDmp).ToList(); if (listDep.Count > 0) { int count = listDep.Count; B_GoodsBianJiaList modelDep = listDep[count - 1]; int intCode = Convert.ToInt32(modelDep.BianJiaBianHao.Substring(0, 8)); intCode++; strOrderNumber = intCode.ToString(); for (int i = 0; i < 8; i++) { strOrderNumber = strOrderNumber.Length < 8 ? "0" + strOrderNumber : strOrderNumber; } } else { strOrderNumber = "00000001"; } return(Json(strOrderNumber, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 删除采购价变价 /// </summary> /// <param name="saleAdjustId"></param> /// <returns></returns> public ActionResult DeleteCaiJiaBianJia(int goodsBianJiaId) { //定义返回 string strMsg = "fail"; try { B_GoodsBianJiaList dbGoods = (from tbGoods in MyModels.B_GoodsBianJiaList where tbGoods.GoodsBianJiaID == goodsBianJiaId select tbGoods).Single(); MyModels.B_GoodsBianJiaList.Remove(dbGoods); if (MyModels.SaveChanges() > 0) { strMsg = "success"; } } catch (Exception e) { Console.WriteLine(e); } return(Json(strMsg, JsonRequestBehavior.AllowGet)); }