示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        /// <summary>
        /// 快递公司详情
        /// </summary>
        public JsonResult GetExpressCompanyDetail(string id)
        {
            var item = ExpressCompanyBusiness.GetExpressCompanyDetail(id);

            JsonDictionary.Add("item", item);
            return(new JsonResult()
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
示例#4
0
        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.ProviderID))
                    {
                        details.Providers = new ProvidersBusiness().GetProviderByID(details.ProviderID);
                    }
                    model.Details.Add(details);
                }
            }

            return(model);
        }