protected void Button_ComSP_Click(object sender, EventArgs e) { //this.Gridview_PMSupply.SelectedIndex = -1; bool temp = false; foreach (GridViewRow item in Gridview_PMSupply.Rows) { RadioButton rb = item.FindControl("RadioButtonMarkup") as RadioButton; if (rb.Checked) { string Pname = Gridview_PMSupply.DataKeys[item.RowIndex].Value.ToString(); temp = true; if (Label31.Text == "新增") { AddTextProvidor.Text = Pname; UpdatePanel_NewInfo.Update(); } if (Label31.Text == "编辑") { EditTextProvidor.Text = Pname; UpdatePanel_EditInfo.Update(); } Panel_Supply.Visible = false; UpdatePanel_Supply.Update(); } } if (!temp) { ScriptManager.RegisterClientScriptBlock(UpdatePanel_Supply, GetType(), "aa", "alert('请选择供应商!')", true); return; } }
protected void Grid_EquipNameModel_RowCommand(object sender, GridViewCommandEventArgs e) { Panel_EditInfo.Visible = false; UpdatePanel_EditInfo.Update(); if (e.CommandName == "Add_Info")//点击增加设备台账 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Grid_EquipNameModel.SelectedIndex = row.RowIndex; //this.Label_enid.Text = Convert.ToString(e.CommandArgument); //string eN_ID = e.CommandArgument.ToString(); string[] al = e.CommandArgument.ToString().Split(new char[] { ',' }); //string EN_ID = al[0]; //this.Label_nid.Text = EN_ID; string EMT_ID = al[1]; Label_mid.Text = EMT_ID; string EN_EquipName = al[2]; Label_nname.Text = EN_EquipName; string EMT_Type = al[3]; Label_mname.Text = EMT_Type; Panel_NewInfo.Visible = true; AddTextname.Text = Label_nname.Text; AddTextmodel.Text = Label_mname.Text; AddAcceptDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); BindDropDownList3(); //DropDownList3.Items.Insert(0, new ListItem("请选择", "请选择")); AddTextno.Text = ""; AddTextLocation.Text = ""; AddTextProvidor.Text = ""; DropDownList4.SelectedValue = ""; //BindDropDownList3(); UpdatePanel_NewInfo.Update(); } }
protected void Close_namemodel_Click(object sender, EventArgs e) { Panel_searchname.Visible = false; Panel_NewInfo.Visible = false; UpdatePanel_NewInfo.Update(); Panel_Supply.Visible = false; UpdatePanel_Supply.Update(); }
protected void Clear_namemodel_Click(object sender, EventArgs e) { Panel_NewInfo.Visible = false; UpdatePanel_NewInfo.Update(); Textnameadd.Text = ""; Textmodeladd.Text = ""; BindGrid_EquipNameModel("", ""); }
protected void Search_namemodel_Click(object sender, EventArgs e) { Panel_NewInfo.Visible = false; UpdatePanel_NewInfo.Update(); string EN_EquipName = Textnameadd.Text.ToString(); string EMT_Type = Textmodeladd.Text.ToString(); BindGrid_EquipNameModel(EN_EquipName, EMT_Type); //this.UpdatePanel_searchname.Update(); }
//检索设备台账 protected void Btn_Search_Click(object sender, EventArgs e) { string condition = GetCondition(); BindGrid_EquipInfo(condition); Panel_InfoItem.Visible = true; UpdatePanel_InfoItem.Update(); UpdatePanel_Search.Update(); Panel_EditInfo.Visible = false; UpdatePanel_EditInfo.Update(); Panel_searchname.Visible = false; Panel_NewInfo.Visible = false; UpdatePanel_NewInfo.Update(); }
protected void Btn_Clear_Click(object sender, EventArgs e) { DropDownList1.Items.Insert(0, new ListItem("请选择", "")); BindDropDownList1(); Textname.Text = ""; Textmodel.Text = ""; Textno.Text = ""; TextLocation.Text = ""; TextProvidor.Text = ""; DropDownList2.SelectedIndex = 0; TextAcceptDate.Text = ""; DropDownList7.SelectedIndex = 0; UpdatePanel_Search.Update(); BindGrid_EquipInfo(""); UpdatePanel_InfoItem.Update(); Panel_EditInfo.Visible = false; UpdatePanel_EditInfo.Update(); Panel_searchname.Visible = false; Panel_NewInfo.Visible = false; UpdatePanel_NewInfo.Update(); }
protected void Grid_EquipInfo_RowCommand(object sender, GridViewCommandEventArgs e) { Panel_searchname.Visible = false; Panel_NewInfo.Visible = false; UpdatePanel_NewInfo.Update(); if (e.CommandName == "Edit_Info")//点击编辑设备台账 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Grid_EquipInfo.SelectedIndex = row.RowIndex; //this.Label_eiid.Text = Convert.ToString(e.CommandArgument); // Clear(); string[] al = e.CommandArgument.ToString().Split(new char[] { ',' }); //string ETT_ID = al[0]; //this.DropDownList5.Value = EN_ID; //string EN_ID = al[1]; //this.Label_mid.Text = EMT_ID; //string EMT_ID = al[2]; //this.Label_nname.Text = EN_EquipName; string EI_ID = al[0]; Label_eiid.Text = EI_ID; string ETT_Type = al[1]; BindDropDownList5(); DropDownList5.Items.FindByText(ETT_Type.ToString().Trim()).Selected = true; string EN_EquipName = al[2]; EditTextname.Text = EN_EquipName; string EMT_Type = al[3]; EditTextmodel.Text = EMT_Type; string EI_No = al[4]; EditTextno.Text = EI_No; string EI_Location = al[5]; EditTextLocation.Text = EI_Location; string EI_Providor = al[6]; EditTextProvidor.Text = EI_Providor; string EI_IsToCare = al[7]; if (EI_IsToCare == "是" || EI_IsToCare == "否") { DropDownList6.SelectedValue = EI_IsToCare; } else { DropDownList6.SelectedIndex = 0; } if (al[8] == "") { EditAcceptDate.Text = ""; } else { DateTime EI_AcceptDate = Convert.ToDateTime(al[8].ToString()); EditAcceptDate.Text = EI_AcceptDate.ToString("yyyy-MM-dd"); } string EI_State = al[9]; //this.DropDownList8.Items.FindByText(EI_State.ToString().Trim()).Selected = true; DropDownList8.SelectedValue = EI_State; // BindDropDownList5(); Panel_EditInfo.Visible = true; //AddAcceptDate.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); UpdatePanel_EditInfo.Update(); } if (e.CommandName == "Delete_Info") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Grid_EquipInfo.SelectedIndex = row.RowIndex; Guid eI_ID = new Guid(Convert.ToString(e.CommandArgument)); //this.Label_enid.Text = Convert.ToString(eI_ID); equipmentInfL.Delete_Proc_D_EquipmentInfInfo(eI_ID); BindGrid_EquipInfo(""); UpdatePanel_InfoItem.Update(); } }