private void InitInstrDetial(string instrID) { string type = ""; string groupID = ""; string testType = ""; string validFlg = ""; if (!string.IsNullOrEmpty(instrID)) { DataSet ds = CurrentInstrumentManage.GetInstrByInstrID(instrID); if (ds.Tables[0].Rows.Count >= 1) { DataRow dr = ds.Tables[0].Rows[0]; type = dr["TYPE"] as string; groupID = dr["GROUP_ID"] as string; testType = dr["TEST_TYPE"] as string; validFlg = dr["VALID_FLG"] as string; TextBoxName.Text = dr["NAME"] as string; TextBoxRegment.Text = dr["REGMENT"] as string; } } InitItem(instrID); InitType(type); InitGroupID(groupID); InitTestType(testType); InitValidFlg(validFlg); InitItemCheckList(); }
private void InitInstr() { string testGroup = DropDownListTestGroup.SelectedValue as string; DataSet ds = CurrentInstrumentManage.GetInstrByGroupID(testGroup); RepeaterInstr.DataSource = ds; RepeaterInstr.DataBind(); }
protected void ButtonSave_Click(object sender, EventArgs e) { string op = Request.QueryString["op"]; string instrID = Request.QueryString["instrumentID"]; string type = DropDownListType.SelectedValue; string groupID = DropDownListGroupID.SelectedValue; string testType = DropDownListTestType.SelectedValue; string validFlg = DropDownListValidFlg.SelectedValue; string name = TextBoxName.Text; string regment = TextBoxRegment.Text; if ("add" == op) { int seq = 1; int maxID = CurrentInstrumentManage.GetMaxInstrID(); string instrumentID = (maxID + 1).ToString(); DataSet ds = GeneralInstrumentItem.GetItemByType(type); List <string> sqls = new List <string>(); string sqlInstr = CurrentInstrumentManage.GetAddSql(int.Parse(instrumentID), groupID, type, name, testType, validFlg, regment); sqls.Add(sqlInstr); foreach (DataRow dr in ds.Tables[0].Rows) { string s = InstrumentItemManage.GetAddSql(instrumentID, dr["ITEM_CODE"] as string, type, seq, seq); sqls.Add(s); seq++; } CurrentInstrumentManage.AddInstrument(sqls); LTP.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "CurrentInstrumentDetail.aspx?instrumentID=" + instrumentID); } else { CurrentInstrumentManage.UpdateInstrByInstrID(instrID, groupID, type, name, testType, validFlg, regment); LTP.Common.MessageBox.Show(this, "保存成功!"); } }