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 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 BtnOK_EditInfo_Click(object sender, EventArgs e) { if (EditTextno.Text.ToString() == "" || DropDownList5.SelectedValue.ToString() == "" || EditTextLocation.Text.ToString() == "" || EditTextProvidor.Text.ToString() == "" || EditAcceptDate.Text.ToString() == "" || DropDownList6.SelectedValue.ToString() == "" || DropDownList8.SelectedValue.ToString() == "") { ScriptManager.RegisterClientScriptBlock(UpdatePanel_EditInfo, GetType(), "alert", "alert('标记*的为必填项,请填写完整!')", true); return; } DataSet ds = equipmentInfL.Search_EquipmentInfInfo("and EI_No = '" + EditTextno.Text + "' and c.EMT_Type='" + EditTextmodel.Text + "'and a.ETT_ID= '" + DropDownList5.SelectedValue.ToString() + "' and EI_Location= '" + EditTextLocation.Text + "'and EI_Providor= '" + EditTextProvidor.Text + "'and EI_IsToCare= '" + DropDownList6.SelectedValue.ToString() + "'and EI_AcceptDate= '" + EditAcceptDate.Text + "'and EI_State='" + DropDownList8.SelectedValue.ToString() + "'"); DataTable dt = ds.Tables[0]; if (dt.Rows.Count != 0) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('系统中已有该设备台账,不能重名!')", true); return; } Guid ETT_ID = new Guid(DropDownList5.SelectedValue.ToString()); Guid EI_ID = new Guid(Label_eiid.Text.ToString()); string EI_No = EditTextno.Text.ToString(); string EI_Location = EditTextLocation.Text.ToString(); string EI_Providor = EditTextProvidor.Text.ToString(); string EI_IsToCare = DropDownList6.SelectedValue.ToString(); DateTime EI_AcceptDate = Convert.ToDateTime((EditAcceptDate.Text.ToString())); string EI_State = DropDownList8.SelectedValue.ToString(); equipmentInfL.Update_EquipmentInfInfo(ETT_ID, EI_ID, EI_No, EI_Location, EI_Providor, EI_IsToCare, EI_AcceptDate, EI_State); BindGrid_EquipInfo(""); Panel_EditInfo.Visible = false; UpdatePanel_EditInfo.Update(); UpdatePanel_InfoItem.Update(); Panel_Supply.Visible = false; UpdatePanel_Supply.Update(); }
protected void Btn_New_Click(object sender, EventArgs e) { Clear(); Panel_searchname.Visible = true; UpdatePanel_searchname.Visible = true; string EN_EquipName = ""; string EMT_Type = ""; BindGrid_EquipNameModel(EN_EquipName, EMT_Type); Panel_EditInfo.Visible = false; UpdatePanel_EditInfo.Update(); //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(); } }