Esempio n. 1
0
        public RepReturn(int billID, short copies, string module)
            : this()
        {
            BillID       = billID;
            this.copies  = copies;
            this._module = module;
            //获取数据
            try
            {
                header = rtnDal.GetHeaderInfoByBillID(BillID);
                List <ReturnDetailsEntity> details = rtnDal.GetReturnDetails(BillID);

                dataSource             = new ReturnBody();
                dataSource.CompanyInfo = new CompanyDal().GetCompanys()[0];
                dataSource.Header      = header;
                dataSource.Details     = details;
                //dataSource.Customer = new CustomerDal().GetByCode(header.Customer);
                lblDate.Text      = DateTime.Now.ToString("yyyy-MM-dd");
                lblWarehouse.Text = GlobeSettings.LoginedUser.WarehouseName;
                lblSoNo.Text      = header.OriginalBillNo;
                this.PageHeight   = details.Count * 63 + 1150;
                //decimal totalAmount = header.CrnAmount;
                ////foreach (ReturnDetailsEntity itm in details)
                ////{
                ////    totalAmount += itm.ReturnAmount;
                ////}
                //totalAmount += header.ReturnAmount;
                //lblTotalAmount.Text = totalAmount.ToString();
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message);
            }
        }
Esempio n. 2
0
        public void ShowFocusDetail()
        {
            ReturnHeaderEntity selectedHeader = SelectedHeader;

            if (selectedHeader == null)
            {
                gridDetails.DataSource = null;
                gvDetails.ViewCaption  = "未选择单据!";
            }
            else
            {
                lstDetail = new List <ReturnDetailsEntity>();
                lstDetail = crnDal.GetReturnDetails(selectedHeader.BillID);
                gridDetails.DataSource = lstDetail;
                gvDetails.ViewCaption  = string.Format("单据号: {0};  客户名称:{1}", selectedHeader.BillNo, selectedHeader.CustomerName);
            }
        }