Exemplo n.º 1
0
        private void BindDataSource()
        {
            var agrs = new Model.SaleQueryAgrs();

            agrs.TicketCode   = txtTicketCode.Text;
            agrs.StoreID      = UserInfo.Instance.StoreID;
            agrs.RecordStatus = 0;
            var result = sale.SaleListQuery(agrs);

            if (result.Rows.Count == 1)
            {
                PosRow         = result.Rows[0];
                agrs.PosID     = new Guid(result.Rows[0]["ID"].ToString());
                txtGuider.Text = result.Rows[0]["Guider"].ToString();

                labelLS.Text       = result.Rows[0]["RecordSerial"].ToString();
                labelLS.Tag        = result.Rows[0]["TicketCode"];
                labelSaleDate.Text = result.Rows[0]["SaleDate"].ToString();
                labelPaytype.Text  = result.Rows[0]["PayTypeName"].ToString();
                labelPaytype.Tag   = result.Rows[0]["PayType"];
                labelGuider.Text   = result.Rows[0]["Guider"].ToString();
                labelGuider.Tag    = result.Rows[0]["GuiderID"];

                if (!string.IsNullOrEmpty(txtBarID.Text))
                {
                    agrs.BarID = txtBarID.Text;
                }

                var data = sale.SaleDetailQuery(agrs);

                data.Columns.Add(new DataColumn()
                {
                    Caption = "退货金额", ColumnName = "ReturnAmount", DefaultValue = 0.00, DataType = typeof(double)
                });
                gridControlReturnGoods.DataSource = data;
            }
            else
            {
                XtraMessageBox.Show("您输入的小票不可进行退货操作!", "系统提示", MessageBoxButtons.OK);
                txtTicketCode.Text = string.Empty;
                txtTicketCode.Focus();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 绑定销售列表
        /// </summary>
        private void BindDataSource()
        {
            var agrs = new SaleQueryAgrs();

            agrs.TicketCode    = txtTickno.Text;
            agrs.SaleStartTime = dateStartTime.DateTime <= DateTime.MinValue ? null : (DateTime?)dateStartTime.DateTime;
            agrs.SaleEndTime   = dateEndTime.DateTime <= DateTime.MinValue ? null : (DateTime?)dateEndTime.DateTime;
            agrs.StoreID       = UserInfo.Instance.StoreID;

            var result = sale.SaleListQuery(agrs);

            gridControlPos.DataSource = result;

            if (result != null && result.Rows.Count > 0)
            {
                var rowid = gridViewPos.GetFocusedDataRow()["ID"].ToString();
                this.BindDetail(rowid);
            }
            else
            {
                gridControlPosDetail.DataSource = null;
            }
        }