public static StorageDoc GetStorageDetail(string docid, string agentid, string clientid) { DataSet ds = StockDAL.GetStorageDetail(docid, clientid); StorageDoc model = new StorageDoc(); if (ds.Tables.Contains("Doc") && ds.Tables["Doc"].Rows.Count > 0) { model.FillData(ds.Tables["Doc"].Rows[0]); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, agentid); model.StatusStr = GetDocStatusStr(model.DocType, model.Status); model.DocTypeStr = CommonBusiness.GetEnumDesc<EnumDocType>((EnumDocType)model.DocType); model.WareHouse = SystemBusiness.BaseBusiness.GetWareByID(model.WareID, model.ClientID); model.Details = new List<StorageDetail>(); foreach (DataRow item in ds.Tables["Details"].Rows) { StorageDetail details = new StorageDetail(); details.FillData(item); if (!string.IsNullOrEmpty(details.UnitID)) { details.UnitName = ProductsBusiness.BaseBusiness.GetUnitByID(details.UnitID, clientid).UnitName; } model.Details.Add(details); } } return model; }
public static StorageDoc GetStorageDetail(string docid, string clientid) { DataSet ds = StockDAL.GetStorageDetail(docid, clientid); StorageDoc model = new StorageDoc(); if (ds.Tables.Contains("Doc") && ds.Tables["Doc"].Rows.Count > 0) { model.FillData(ds.Tables["Doc"].Rows[0]); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, clientid); model.StatusStr = GetDocStatusStr(model.DocType, model.Status); model.WareHouse = SystemBusiness.BaseBusiness.GetWareByID(model.WareID, model.ClientID); model.Details = new List<StorageDetail>(); foreach (DataRow item in ds.Tables["Details"].Rows) { StorageDetail details = new StorageDetail(); details.FillData(item); model.Details.Add(details); } } return model; }