/// <summary> /// 修改数据到表TblOut_Into_ware /// </summary> /// <param name="name">Out_Into_ware的U_nam名字</param> /// <param name="outIntoWare">更新成的表</param> public void UpdataOut_Into_wares(string id, Out_Into_ware outIntoWare) { WarehouseERPDAL dB = new WarehouseERPDAL(); var model = dB.out_into_wares.Where(c => c.Table_Id == id).FirstOrDefault(); if (model != null) { model = outIntoWare; } }
/// <summary> /// 插入数据到表TblOut_Into_ware /// </summary> /// <param name="outIntoWare">插入的数据</param> /// <returns></returns> public Out_Into_ware InsertOut_Into_ware(Out_Into_ware outIntoWare) { //dB.out_into_wares.Add(outIntoWare); //dB.SaveChanges(); //return outIntoWare; WarehouseERPDAL dB = new WarehouseERPDAL(); dB.out_into_wares.Add(outIntoWare); dB.SaveChanges(); return(outIntoWare); }
//通过相应的storage表获得exist表 public Exist GetExist(Storage storage) { Exist exist = new Exist(); exist.IO_Id = storage.IO_Id; exist.Count = storage.Count; exist.IntoDate = DateTime.Now; exist.Co_id = storage.Co_id; OutIntoWareBusinessLayer outIntoWareBusinessLayer = new OutIntoWareBusinessLayer(); Out_Into_ware out_Into_Ware = outIntoWareBusinessLayer.GetOut_Into_ware(storage.IO_Id); exist.W_id = out_Into_Ware.Ware_id; exist.U_id = out_Into_Ware.User_id; return(exist); }
//[MultiButton("入库")] public ActionResult MakeTableSubmit(string Sumbit) { if (Sumbit == null && IsIntoOutWaretor) { return(new EmptyResult()); } Session["Table_Id"] = null; //string Sumbit = "入库"; Out_Into_ware out_Into_Ware = new Out_Into_ware(); out_Into_Ware.Make_date = DateTime.Now;//时间 UserBusinessLayer userBusinessLayer = new UserBusinessLayer(); WarehouseBusinessLayer warehouseBusinessLayer = new WarehouseBusinessLayer(); OutIntoWareBusinessLayer outIntoWareBusinessLayer1 = new OutIntoWareBusinessLayer(); User user = userBusinessLayer.GetUser(Session["User"].ToString()); out_Into_Ware.User_id = user.U_Id; //负责人编号 out_Into_Ware.Ware_id = warehouseBusinessLayer.GetId(user.U_point); //仓库编号 //创建表单号 Table_Id = "12343"; if (Sumbit == "商品入库") { I_type = "入库"; IsIntoOutWaretor = true; out_Into_Ware.type = IO_Type.INTO; //out_Into_Ware.Table_Id = "INTO" + Table_Id; out_Into_Ware.Table_Id = outIntoWareBusinessLayer1.GetMaxTable(IO_Type.INTO); } else if (Sumbit == "商品出库") { I_type = "出库"; IsIntoOutWaretor = true; out_Into_Ware.type = IO_Type.OUT; //out_Into_Ware.Table_Id = "OUT" + Table_Id; out_Into_Ware.Table_Id = outIntoWareBusinessLayer1.GetMaxTable(IO_Type.OUT); } //Session["Table_Id"] = out_Into_Ware.Table_Id; Table_Id = out_Into_Ware.Table_Id; //存入数据库 OutIntoWareBusinessLayer outIntoWareBusinessLayer = new OutIntoWareBusinessLayer(); outIntoWareBusinessLayer.InsertOut_Into_ware(out_Into_Ware); return(RedirectToAction("RedirectInOutWarehouse")); }