Ejemplo n.º 1
0
        private void GridView2_MouseUp(object sender, MouseEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(comboStaff.Text))
            {
                XtraMessageBox.Show("请选择技师");
                return;
            }
            if (e.Button == MouseButtons.Left)
            {
                SkillVo  vo     = (SkillVo)this.gridView2.GetRow(this.gridView2.FocusedRowHandle);
                double[] prices = SelectDao.GetSkillPrice(vo.SkillName, "现金");

                string staffName = comboStaff.Text;
                string staffId   = SelectDao.SelectSatffIDByName(staffName);
                //创建ID
                //orderId = GenrateIDUtil.GenerateOrderID();

                DateTime tempTime = new DateTime();
                if (_tempOrderList.Count > 0)
                {
                    tempTime = _tempOrderList[_tempOrderList.Count - 1].EndTime;
                }
                else
                {
                    tempTime = DateTime.Now;
                }
                TempOrderVo tempVo = new TempOrderVo()
                {
                    Id     = 0,
                    RoomID = _rommVo.RoomId,
                    //OrderID = orderId,
                    SkillId   = vo.SkillId,
                    SkillName = vo.SkillName,
                    StaffID   = staffId,
                    StaffName = staffName,
                    WorkType  = _itype,
                    StartTime = tempTime,
                    EndTime   = SelectDao.GetTempOrderEndTime(vo.SkillId, tempTime),
                    PriceA    = prices[0],
                    PriceB    = prices[1],
                    PriceC    = prices[2],
                    CompanyId = SystemConst.companyId
                };
                _tempOrderList.Add(tempVo);
                this.gridControl1.DataSource = _tempOrderList;
                this.gridControl1.RefreshDataSource();
                this.gridView1.BestFitColumns();

                GetPriceByType(prices);
                this.labelPrice.Text = _price.ToString("f8");
            }
        }