Пример #1
0
        private void BindData()
        {
            string          id   = Request.QueryString["id"];
            InStockBLL      bll  = null;
            InStockBillView info = new InStockBillView();

            try
            {
                bll = BLLFactory.CreateBLL <InStockBLL>();
                if (string.IsNullOrEmpty(id) == false)
                {
                    info.ID = id;
                    info    = bll.GetViewInfo(info);

                    UIBindHelper.BindForm(this.Page, info);

                    foreach (InStockDetailView detail in info.Details)
                    {
                        detail.UnitName = string.IsNullOrEmpty(detail.UnitName) == false ? detail.UnitName : detail.MainUnitName;
                    }

                    this.GvList.DataSource = info.Details;
                    this.GvList.DataBind();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
        /// <summary>
        /// 获取入库单浏览信息
        /// </summary>
        /// <param name="info">获取条件</param>
        /// <returns>入库单浏览信息</returns>
        public InStockBillView GetViewInfo(InStockBillView info)
        {
            string sql = null;
            List <DataParameter> parameters = new List <DataParameter>();

            using (IDataSession session = AppDataFactory.CreateMainSession())
            {
                //获取基本信息
                sql = @"select t1.ID,t1.BillNO,t1.BillDate,t2.ProviderName as Provider,t3.Description as InStockMode,
                            t4.Description as Warehouse,u1.USERNAME as DeliveryPerson,u2.USERNAME as Receiver,
                            u3.USERNAME as WHHeader,t1.Remark 
                        from T_WH_InStockBill t1
                        left outer join T_WH_Provider t2 on t1.ProviderID=t2.ID
                        left outer join T_WH_InMode t3 on t1.InStockMode=t3.ID
                        left outer join T_WH_Warehouse t4 on t1.Warehouse=t4.ID
                        left outer join T_USER u1 on t1.DeliveryPerson=u1.USERID
                        left outer join T_USER u2 on t1.Receiver=u2.USERID
                        left outer join T_USER u3 on t1.WHHeader=u3.USERID
                        where t1.ID=?ID";

                info = session.Get <InStockBillView>(sql, new DataParameter("ID", info.ID));

                //获取明细信息
                sql = @"select t1.ID,t1.Seq,t1.MatBarCode,t1.MatID,t2.MatCode as MatCode,t2.MatName as MatName,t1.ProduceDate,
                            t1.InAmount,t1.InPrice,t1.InSum,t3.Description as SaveSite,t1.Remark,
                            twms.UnitName,t1.MatSpec,t5.Description as MainUnitName
                        from T_WH_InStockDetail t1
                        left outer join T_WH_Mat t2 on t1.MatID=t2.ID
                        left outer join T_WH_MatIDCode mic on t1.MatBarCode=mic.IDCode
                        left outer join T_WH_MatSpec twms on mic.MatSpec = twms.ID
                        left outer join T_WH_Site t3 on t1.SaveSite=t3.ID
                        left outer join T_WH_MatUnit t5 on t2.UnitCode=t5.ID
                        where t1.BillID=@BillID";
                parameters.Add(new DataParameter("BillID", info.ID));

                info.Details = session.GetList <InStockDetailView>(sql, parameters.ToArray()).ToList();
            }

            return(info);
        }
Пример #3
0
 /// <summary>
 /// 获取入库单浏览信息
 /// </summary>
 /// <param name="info">获取条件</param>
 /// <returns>入库单浏览信息</returns>
 public InStockBillView GetViewInfo(InStockBillView info)
 {
     return(new InStockDAL().GetViewInfo(info));
 }