public static List<StorageDoc> GetStorageDocList(string userid, EnumDocType type, EnumDocStatus status, string keywords, string begintime, string endtime, string wareid, string providerid, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string clientID) { DataSet ds = StockDAL.GetStorageDocList(userid, (int)type, (int)status, keywords, begintime, endtime, wareid, providerid, pageSize, pageIndex, ref totalCount, ref pageCount, clientID); List<StorageDoc> list = new List<StorageDoc>(); foreach (DataRow dr in ds.Tables[0].Rows) { StorageDoc model = new StorageDoc(); model.FillData(dr); model.StatusStr = GetDocStatusStr(model.DocType, model.Status); model.Details = new List<StorageDetail>(); if (ds.Tables.Contains("Details")) { foreach (DataRow detail in ds.Tables["Details"].Select("DocID='" + model.DocID + "'")) { StorageDetail dModel = new StorageDetail(); dModel.FillData(detail); model.Details.Add(dModel); } } list.Add(model); } return list; }
public static List<StorageDoc> GetStorageDocDetails(string docid,string clientid) { DataSet ds = StockDAL.BaseProvider.GetStorageDocDetails(docid); List<StorageDoc> list = new List<StorageDoc>(); foreach (DataRow dr in ds.Tables["Doc"].Rows) { StorageDoc model = new StorageDoc(); model.FillData(dr); List<StorageDetail> details = new List<StorageDetail>(); foreach (DataRow detailDR in ds.Tables["Details"].Select("DocID = '" + model.DocID + "'")) { StorageDetail detail = new StorageDetail(); detail.FillData(detailDR); details.Add(detail); } model.Details = details; var user = OrganizationBusiness.GetUserByUserID(model.CreateUserID, clientid); model.UserName = user != null ? user.Name : ""; list.Add(model); } return list; }
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.DocTypeStr = CommonBusiness.GetEnumDesc<EnumDocType>((EnumDocType)model.DocType); if (!string.IsNullOrEmpty(model.ExpressID)) { model.Express = ExpressCompanyBusiness.GetExpressCompanyDetail(model.ExpressID); } 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 = new ProductsBusiness().GetUnitByID(details.UnitID).UnitName; } if (!string.IsNullOrEmpty(details.ProdiverID)) { details.Providers = new ProvidersBusiness().GetProviderByID(details.ProdiverID); } model.Details.Add(details); } } return model; }