public static List <GoodsDoc> GetGoodsDocByOrderID(string orderid, string taskid, EnumDocType type, string clientid) { DataSet ds = StockDAL.BaseProvider.GetGoodsDocByOrderID(orderid, taskid, (int)type, clientid); List <GoodsDoc> list = new List <GoodsDoc>(); foreach (DataRow dr in ds.Tables["Doc"].Rows) { GoodsDoc model = new GoodsDoc(); model.FillData(dr); if (!string.IsNullOrEmpty(model.ExpressID)) { model.Express = ExpressCompanyBusiness.GetExpressCompanyDetail(model.ExpressID); } model.CreateUser = OrganizationBusiness.GetUserCacheByUserID(model.CreateUserID, clientid); if (!string.IsNullOrEmpty(model.OwnerID)) { model.Owner = OrganizationBusiness.GetUserCacheByUserID(model.OwnerID, clientid); } model.Details = new List <GoodsDocDetail>(); if (ds.Tables.Contains("Details")) { foreach (DataRow detail in ds.Tables["Details"].Select("DocID='" + model.DocID + "'")) { GoodsDocDetail goodsDetailModel = new GoodsDocDetail(); goodsDetailModel.FillData(detail); model.Details.Add(goodsDetailModel); } } list.Add(model); } return(list); }
public static GoodsDoc GetGoodsDocDetail(string docid, string clientid) { DataSet ds = StockDAL.GetGoodsDocDetail(docid, clientid); GoodsDoc model = new GoodsDoc(); if (ds.Tables.Contains("Doc") && ds.Tables["Doc"].Rows.Count > 0) { model.FillData(ds.Tables["Doc"].Rows[0]); model.CreateUser = OrganizationBusiness.GetUserCacheByUserID(model.CreateUserID, clientid); model.DocTypeStr = CommonBusiness.GetEnumDesc <EnumGoodsDocType>((EnumGoodsDocType)model.DocType); if (!string.IsNullOrEmpty(model.ExpressID)) { model.Express = ExpressCompanyBusiness.GetExpressCompanyDetail(model.ExpressID); } model.Details = new List <GoodsDocDetail>(); foreach (DataRow item in ds.Tables["Details"].Rows) { GoodsDocDetail details = new GoodsDocDetail(); details.FillData(item); model.Details.Add(details); } } return(model); }