Example #1
0
        private void BtnAddPrice_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;
            }
            SkillPriceVo vo = new SkillPriceVo()
            {
                SkillName = this.textServerNP.Text,
                PriceType = this.comboType.Text,
                PriceA    = Convert.ToDouble(this.textPriceA.Text),
                PriceB    = Convert.ToDouble(this.textPriceB.Text),
                PriceC    = Convert.ToDouble(this.textPriceC.Text),
                Remark    = this.textreamark.Text,
                CompanyId = SystemConst.companyId
            };

            if (SelectDao.IsExistSkillPrice(vo.SkillName, vo.PriceType))
            {
                XtraMessageBox.Show("此价格已经存在!");
                return;
            }
            if (InsertDao.InsertData(vo, typeof(SkillPriceVo)) > 0)
            {
                XtraMessageBox.Show("添加价格成功!");
                RefreshSkillPrice(this.textServerNP.Text);
            }
        }