public DataSet GetJGCandDep() { DataTable dt = new DataTable(); dt.TableName = "dt"; dt.Columns.Add("ID", typeof(int)); dt.Columns.Add("Name", typeof(string)); dt.Columns.Add("IsJGC", typeof(bool)); dt.Rows.Add(0, "", false); DataTable dtCom = GetList("TypeID=3").Tables[0]; for (int i = 0; i < dtCom.Rows.Count; i++) { dt.Rows.Add(Convert.ToInt32(dtCom.Rows[i]["ID"]) * -1, dtCom.Rows[i]["Name"], true); } Hownet.BLL.Deparment bllDep = new Deparment(); DataTable dtDep = bllDep.GetTypeList("缝制").Tables[0]; for (int i = 0; i < dtDep.Rows.Count; i++) { dt.Rows.Add(dtDep.Rows[i]["ID"], dtDep.Rows[i]["Name"], false); } DataSet ds = new DataSet(); ds.DataSetName = "ds"; ds.Tables.Add(dt); return(ds); }
/// <param name="t">真为审核入库,假为弃审出库</param> public bool VerifyStock(int MainID, int PackID, bool t, int VerifyMan) { try { Hownet.BLL.StockBack bllSB = new StockBack(); Hownet.BLL.StockBackInfo bllSBI = new StockBackInfo(); Hownet.BLL.Repertory bllRep = new Repertory(); Hownet.BLL.Deparment bllDep = new Deparment(); Hownet.BLL.PackAmount bllPA = new PackAmount(); Hownet.BLL.MaterielList bllML = new MaterielList(); Hownet.BLL.Materiel bllMat = new Materiel(); Hownet.Model.PackAmount modPA = new Hownet.Model.PackAmount(); Hownet.Model.MaterielList modML = new Hownet.Model.MaterielList(); Hownet.Model.StockBack modSB = bllSB.GetModel(MainID); Hownet.Model.StockBackInfo modSBI = new Hownet.Model.StockBackInfo(); Hownet.Model.Repertory modRep = new Hownet.Model.Repertory(); Hownet.Model.Deparment modDep = bllDep.GetModel(PackID); List <Hownet.Model.StockBackInfo> li = bllSBI.DataTableToList(bllSBI.GetList("(MainID=" + MainID + ")").Tables[0]); modPA.DepartmentID = PackID; for (int i = 0; i < li.Count; i++) { modRep.BrandID = modPA.BrandID = modML.BrandID = li[i].BrandID; modRep.ColorID = modPA.ColorID = modML.ColorID = li[i].ColorID; modRep.ColorOneID = modPA.ColorOneID = modML.ColorOneID = li[i].ColorOneID; modRep.ColorTwoID = modPA.ColorTwoID = modML.ColorTwoID = li[i].ColorTwoID; modRep.SizeID = modPA.SizeID = modML.SizeID = li[i].SizeID; modRep.MaterielID = modPA.MaterielID = modML.MaterielID = li[i].MaterielID; modRep.MeasureID = modPA.MeasureID = modML.MeasureID = bllMat.GetModel(li[i].MaterielID).MeasureID; modRep.PlanID = modPA.PlanID = 0; modRep.Remark = modPA.Remark = string.Empty; modRep.DepartmentID = modPA.DepartmentID = modSB.DepotID; modRep.Amount = modPA.Amount = li[i].Amount; modSBI = bllSBI.GetModel(li[i].StockInfoID); if (modSBI != null) { if (t) { modSBI.NotAmount -= li[i].Amount; } else { modSBI.NotAmount += li[i].Amount; } bllSBI.Update(modSBI); } if (li[i].MListID == 0) { modRep.MListID = modPA.MListID = li[i].MListID = bllML.GetID(modML); bllSBI.Update(li[i]); } else { modRep.MListID = modPA.MListID = li[i].MListID; } if (modDep.TypeID == 39) { bllPA.InOrOut(modPA, t); } else if (modDep.TypeID == 42) { bllRep.InOrOut(modRep, t); } } if (t) { modSB.IsVerify = 3; modSB.VerifyDate = DateTime.Today; modSB.VerifyMan = VerifyMan; } else { modSB.IsVerify = 1; modSB.VerifyDate = DateTime.Parse("1900-1-1"); modSB.VerifyMan = 0; } bllSB.Update(modSB); return(true); } catch (Exception ex) { return(false); } }