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); } }
private void BtnUpdatePrice_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 = (SkillPriceVo)this.gridView3.GetRow(this.gridView3.FocusedRowHandle); vo.SkillName = this.textServerNP.Text; vo.PriceType = this.comboType.Text; vo.PriceA = Convert.ToDouble(this.textPriceA.Text); vo.PriceB = Convert.ToDouble(this.textPriceB.Text); vo.PriceC = Convert.ToDouble(this.textPriceC.Text); vo.Remark = this.textreamark.Text; if (UpdateDao.UpdateByID(vo) > 0) { XtraMessageBox.Show("更新价格成功!"); RefreshSkillPrice(this.textServerNP.Text); } }
private void GridView3_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e) { SkillPriceVo vo = (SkillPriceVo)this.gridView3.GetRow(this.gridView3.FocusedRowHandle); comboType.Text = vo.PriceType; textPriceA.Text = vo.PriceA.ToString(); textPriceB.Text = vo.PriceB.ToString(); textPriceC.Text = vo.PriceC.ToString(); textreamark.Text = vo.Remark; }
private void BtnDelPrice_Click(object sender, EventArgs e) { SkillPriceVo vo = (SkillPriceVo)this.gridView3.GetRow(this.gridView3.FocusedRowHandle); if (DeleteDao.DeleteByID(vo.Id, typeof(SkillPriceVo)) > 0) { XtraMessageBox.Show("删除价格成功!"); RefreshSkillPrice(this.textServerNP.Text); } else { XtraMessageBox.Show("删除价格失败!"); } }