public ActionResult ShenHeZaiDan(B_SellCheckBatchList OK, B_SellCheckBatchDetaiList OKDetai, bool state) { string strMag = "fali"; ReturnJsonVo returnJson = new ReturnJsonVo(); try { B_SellCheckBatchList MyB_ConverList = new B_SellCheckBatchList(); MyB_ConverList.SellCheckBatchID = OK.SellCheckBatchID; MyB_ConverList.Remember = OK.Remember; MyB_ConverList.MaiChangID = OK.MaiChangID; MyB_ConverList.SpouseBRanchID = OK.SpouseBRanchID; MyB_ConverList.DrugTypeID = OK.DrugTypeID; MyB_ConverList.StaffID = OK.StaffID; MyB_ConverList.RegisterTime = OK.RegisterTime; MyB_ConverList.StaffIDTwo = OK.StaffIDTwo; MyB_ConverList.ExamineTime = OK.ExamineTime; myModels.Entry(MyB_ConverList).State = System.Data.Entity.EntityState.Modified; myModels.SaveChanges(); if (MyB_ConverList.SellCheckBatchID > 0) { strMag = "succsee"; B_SellCheckBatchList wafrtbool = (from tbbool in myModels.B_SellCheckBatchList where tbbool.SellCheckBatchID == OK.SellCheckBatchID select tbbool).Single(); //查询原状态 wafrtbool.ExamineNot = state; //改变是否为冲红单状态 myModels.Entry(wafrtbool).State = EntityState.Modified; if (myModels.SaveChanges() > 0)//保存 { returnJson.State = true; returnJson.Text = "修改成功"; } else { returnJson.State = false; returnJson.Text = "修改失败"; } } } catch (Exception e) { Console.WriteLine(e); } return(Json(new { strMag, returnJson }, JsonRequestBehavior.AllowGet)); }
public ActionResult UpterDiaoBa(B_SellCheckBatchList OK, B_SellCheckBatchDetaiList OKDetai) { string strMag = "fali"; try { B_SellCheckBatchList MyB_ConverList = new B_SellCheckBatchList(); MyB_ConverList.SellCheckBatchID = OK.SellCheckBatchID; MyB_ConverList.Remember = OK.Remember; MyB_ConverList.MaiChangID = OK.MaiChangID; MyB_ConverList.SpouseBRanchID = OK.SpouseBRanchID; MyB_ConverList.DrugTypeID = OK.DrugTypeID; MyB_ConverList.StaffID = OK.StaffID; MyB_ConverList.RegisterTime = OK.RegisterTime; myModels.Entry(MyB_ConverList).State = System.Data.Entity.EntityState.Modified; myModels.SaveChanges(); B_SellCheckBatchDetaiList ConverDeTailList = new B_SellCheckBatchDetaiList(); ConverDeTailList.SellCheckBatchDetailD = OKDetai.SellCheckBatchDetailD; ConverDeTailList.SellCheckBatchID = OK.SellCheckBatchID; ConverDeTailList.MumberOfPackages = OKDetai.MumberOfPackages; ConverDeTailList.ConverDeTaiID = OKDetai.ConverDeTaiID; myModels.Entry(ConverDeTailList).State = System.Data.Entity.EntityState.Modified; myModels.SaveChanges(); strMag = "succsee"; } catch (Exception e) { Console.WriteLine(e); } return(Json(strMag, JsonRequestBehavior.AllowGet)); }