private void btn_OK_Click(object sender, EventArgs e) { string sErr = ""; if (!FrmSTable.IsInteger(this.txt_Qty.Text.Trim())) { MessageBox.Show(""); this.txt_Qty.SelectAll(); this.txt_Qty.FindForm(); } else { int pQty = int.Parse(this.txt_Qty.Text.Trim()); string pAreaId = ""; if ((this.cmb_Area.Text.Trim() != "") && (this.cmb_Area.SelectedValue != null)) { pAreaId = this.cmb_Area.SelectedValue.ToString().Trim(); } string pPltSpec = ""; if ((this.cmb_PltSpec.Text.Trim() != "") && (this.cmb_PltSpec.SelectedValue != null)) { pPltSpec = this.cmb_PltSpec.SelectedValue.ToString().Trim(); } string str4 = PubDBCommFuns.sp_CreatePaleltNo(base.AppInformation.SvrSocket, pQty, 6, "", pAreaId, pPltSpec, out sErr); MessageBox.Show(sErr); } }
private void btn_OK_Click(object sender, EventArgs e) { if (this.bds_Item.Count == 0) { MessageBox.Show("无字段字典表数据!"); } else if (!(this.cmb_Item.Text.Trim() != "") || (this.cmb_Item.SelectedIndex <= -1)) { MessageBox.Show("请选修改项目!"); } else { bool flag = true; DataRowView current = null; current = (DataRowView)this.bds_Item.Current; if (current != null) { string str = current["cColName"].ToString(); string text = this.txt_ItemValue.Text; string str3 = current["cDataType"].ToString(); string str4 = str3.Trim(); if ((str4 != null) && (str4 != "string")) { if (!(str4 == "int")) { if (str4 == "double") { flag = FrmSTable.IsNumberic(text.Trim()); } else if (str4 == "date") { flag = FrmSTable.IsDateTime(text.Trim()); } else if (!(str4 == "bool")) { } } else { flag = FrmSTable.IsInteger(text.Trim()); } } if (!flag) { MessageBox.Show("录入项目值为非法数据,请录入正确的数据!"); this.txt_ItemValue.SelectAll(); this.txt_ItemValue.Focus(); } else if (this._doBatchUpdateData != null) { this._doBatchUpdateData(str.Trim(), text, str3.Trim()); } } } }