protected void ImageButtonDelete_Click(object sender, ImageClickEventArgs e) { string instID = TextBoxInstID.Text; string type = ((ImageButton)sender).CommandArgument; int i = GeneralInstrumentManage.DeleteInstrByType(type); InitInstrument(instID); }
private void InitInst(string type) { DataSet ds = GeneralInstrumentManage.GetInstrumentByType(type); if (ds.Tables[0].Rows.Count >= 1) { DataRow dr = ds.Tables[0].Rows[0]; TextBoxType.Text = dr["TYPE"] as string; TextBoxName.Text = dr["NAME"] as string; TextBoxInstID.Text = dr["INSTR_ID"] as string; TextBoxMaker.Text = dr["MAKER"] as string; } }
private void InitType(string type) { DataSet ds = GeneralInstrumentManage.GetInstrument(); DropDownListType.DataSource = ds; DropDownListType.DataTextField = "NAME"; DropDownListType.DataValueField = "TYPE"; DropDownListType.DataBind(); if (!string.IsNullOrEmpty(type)) { DropDownListType.SelectedValue = type; } }
private void InitInstrument(string instID) { int pageSize = AspNetPager1.PageSize; int pageNo = AspNetPager1.CurrentPageIndex - 1; int start = pageNo * pageSize + 1; int end = (pageNo + 1) * pageSize; DataSet ds = GeneralInstrumentManage.GetInstrumentByID(instID, start, end); int count = GeneralInstrumentManage.GetInstrumentCountByID(instID); AspNetPager1.RecordCount = count; AspNetPager1.CustomInfoHTML = "记录总数:<b>" + AspNetPager1.RecordCount.ToString() + "</b>"; RepeaterInstr.DataSource = ds; RepeaterInstr.DataBind(); }
protected void ButtonSave_Click(object sender, EventArgs e) { string op = Request.QueryString["op"]; string type = TextBoxType.Text; string name = TextBoxName.Text; string maker = TextBoxMaker.Text; string instrID = TextBoxInstID.Text; if ("add" == op) { GeneralInstrumentManage.AddInstrument(type, name, maker, instrID); } else { GeneralInstrumentManage.UpdateInstrByType(type, name, maker, instrID); } Response.Redirect("GeneralInstrumentList.aspx"); }