Esempio n. 1
0
        private void GridView1_SelectionChanged(object sender, DevExpress.Data.SelectionChangedEventArgs e)
        {
            TempOrderVo selectVo = (TempOrderVo)this.gridView1.GetRow(this.gridView1.FocusedRowHandle);

            if (e.Action == CollectionChangeAction.Add)
            {
                selectedVoList.Add(selectVo);
            }
            else if (e.Action == CollectionChangeAction.Remove)
            {
                selectedVoList.Remove(selectVo);
            }
            else
            {
                if (!bcheckAll)
                {
                    bcheckAll = true;
                    foreach (TempOrderVo vo in tempVoList)
                    {
                        selectedVoList.Add(vo);
                    }
                }
                else
                {
                    bcheckAll = false;
                    foreach (TempOrderVo vo in tempVoList)
                    {
                        selectedVoList.Remove(vo);
                    }
                }
            }
        }
Esempio n. 2
0
        private void BtnCancelOrder_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            List <TempOrderVo> tempVoList = (List <TempOrderVo>) this.gridView1.DataSource;
            TempOrderVo        vo         = (TempOrderVo)this.gridView1.GetRow(this.gridView1.FocusedRowHandle);

            tempVoList.Remove(vo);
            this.gridControl1.RefreshDataSource();
        }
Esempio n. 3
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");
            }
        }
Esempio n. 4
0
        private double CalculationPrice(TempOrderVo vo)
        {
            string priceType   = this.comboType.Text;
            double serverPrice = SelectDao.GetSkillPriceDetail(vo.SkillName, vo.WorkType, priceType);
            double gstPrice    = 0;
            double totalPrice  = 0;

            if (priceType.Equals("现金") || priceType.Equals("Visa卡"))
            {
                gstPrice = (serverPrice * 6) / 106;
            }
            gstPrice   = Math.Round(gstPrice, 2, MidpointRounding.AwayFromZero);
            totalPrice = serverPrice + gstPrice;
            return(totalPrice);
        }
Esempio n. 5
0
 private void GridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
 {
     if (string.Equals(e.Column.FieldName, "EndTime"))
     {
         TempOrderVo vo = (TempOrderVo)this.gridView1.GetRow(this.gridView1.FocusedRowHandle);
         if (vo.EndTime == default(DateTime))
         {
             e.DisplayText = "------";
         }
     }
     if (string.Equals(e.Column.FieldName, "StartTime"))
     {
         TempOrderVo vo = (TempOrderVo)this.gridView1.GetRow(this.gridView1.FocusedRowHandle);
         if (vo.StartTime == default(DateTime))
         {
             e.DisplayText = "------";
         }
     }
 }