Example #1
0
        private void BtnAddT_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(this.textPriceA.Text) || string.IsNullOrWhiteSpace(this.textPriceB.Text) || string.IsNullOrWhiteSpace(this.textPriceC.Text))
            {
                XtraMessageBox.Show("价格信息不完整!");
                return;
            }
            if (!FilterUtil.isNumberic(this.textPriceA.Text) || !FilterUtil.isNumberic(this.textPriceB.Text) || !FilterUtil.isNumberic(this.textPriceC.Text))
            {
                XtraMessageBox.Show("价格信息不正确!");
                return;
            }
            SkillCommisionVo vo = new SkillCommisionVo()
            {
                SkillName  = this.textSkillName.Text,
                StaffLevel = this.comboLevel.Text,
                PriceA     = Convert.ToDouble(this.textPriceAT.Text),
                PriceB     = Convert.ToDouble(this.textPriceBT.Text),
                PriceC     = Convert.ToDouble(this.textPriceCT.Text),
                Remark     = this.textreamark.Text,
                CompanyId  = SystemConst.companyId
            };

            if (InsertDao.InsertData(vo, typeof(SkillCommisionVo)) > 0)
            {
                XtraMessageBox.Show("添加技师提成成功!");
                RefreshSkillCommision(this.textSkillName.Text);
            }
        }
Example #2
0
        private void BtnUpdateT_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(this.textPriceA.Text) || string.IsNullOrWhiteSpace(this.textPriceB.Text) || string.IsNullOrWhiteSpace(this.textPriceC.Text))
            {
                XtraMessageBox.Show("价格信息不完整!");
                return;
            }
            if (!FilterUtil.isNumberic(this.textPriceA.Text) || !FilterUtil.isNumberic(this.textPriceB.Text) || !FilterUtil.isNumberic(this.textPriceC.Text))
            {
                XtraMessageBox.Show("价格信息不正确!");
                return;
            }
            SkillCommisionVo vo = (SkillCommisionVo)this.gridView4.GetRow(this.gridView4.FocusedRowHandle);

            vo.SkillName  = this.textSkillName.Text;
            vo.StaffLevel = this.comboLevel.Text;
            vo.PriceA     = Convert.ToDouble(this.textPriceAT.Text);
            vo.PriceB     = Convert.ToDouble(this.textPriceBT.Text);
            vo.PriceC     = Convert.ToDouble(this.textPriceCT.Text);
            vo.Remark     = this.textreamark.Text;
            if (UpdateDao.UpdateByID(vo) > 0)
            {
                XtraMessageBox.Show("更新提成成功!");
                RefreshSkillCommision(this.textSkillName.Text);
            }
        }
Example #3
0
        //private bool CheckParam(List<WorkTypeVo> voList)
        //{
        //    foreach (WorkTypeVo vo in voList)
        //    {
        //        if (string.IsNullOrWhiteSpace(vo.TypeName))
        //        {
        //            XtraMessageBox.Show("名称不能为空!");
        //            return false;
        //        }
        //    }
        //    var list = voList.GroupBy(v => v.TypeName).Where(v => v.Count() > 1).ToList();
        //    if (list.Count > 0)
        //    {
        //        XtraMessageBox.Show("名称不能相同!");
        //        return false;
        //    }
        //    return true;
        //}

        private void GridView4_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            SkillCommisionVo vo = (SkillCommisionVo)this.gridView4.GetRow(this.gridView4.FocusedRowHandle);

            comboLevel.Text  = vo.StaffLevel;
            textPriceAT.Text = vo.PriceA.ToString();
            textPriceBT.Text = vo.PriceB.ToString();
            textPriceCT.Text = vo.PriceC.ToString();
            textreamark.Text = vo.Remark;
        }
Example #4
0
        private void BtnDelT_Click(object sender, EventArgs e)
        {
            SkillCommisionVo vo = (SkillCommisionVo)this.gridView4.GetRow(this.gridView4.FocusedRowHandle);

            if (DeleteDao.DeleteByID(vo.Id, typeof(SkillCommisionVo)) > 0)
            {
                XtraMessageBox.Show("删除提成成功!");
                RefreshSkillCommision(this.textSkillName.Text);
            }
            else
            {
                XtraMessageBox.Show("删除提成失败!");
            }
        }