public static long InsertSwitchWorkLibPID() { long id = -1; TSwitchWorkWearLibraryManager objManager = new TSwitchWorkWearLibraryManager(); var dt = objManager.GetDataSetByWhere("order by ID DESC limit 1").Tables[0]; if (dt.Rows.Count < 1) { return(0); } if (long.TryParse(dt.Rows[0]["ID"].ToString(), out id)) { return(id + 1); } return(id); }
private void CommitData() { if (this.tb_switchWorkWearCode.Text.Trim() == "") { MessageBox.Show("转接工装代号不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (this.tb_switchType.Text.Trim() == "") { MessageBox.Show("转接型号不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } TSwitchWorkWearLibraryManager switchWorkWearLibraryManager = new TSwitchWorkWearLibraryManager(); var dt = switchWorkWearLibraryManager.GetDataSetByWhere($"where SwitchWorkWearCode like '%{this.tb_switchWorkWearCode.Text}%'").Tables[0]; if (dt.Rows.Count > 0) { MessageBox.Show("转接工装代号已存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } this.switchWorkWearCode = this.tb_switchWorkWearCode.Text.Trim(); this.switchType = this.tb_switchType.Text.Trim(); this.remark = this.tb_remark.Text.Trim(); }
private void Init() { switchWorkWearLibraryManager = new TSwitchWorkWearLibraryManager(); RadGridViewProperties.SetRadGridViewProperty(this.radGridView1, false, true, 4); InitFuncState(); }