//选择备件以及提交 protected void BtnOK_NewSpare_Click(object sender, EventArgs e) { foreach (GridViewRow item in Grid_NewEquipSpare.Rows) { CheckBox cb = item.FindControl("ckb") as CheckBox; if (cb.Checked) { Guid eMT_ID = new Guid(Label_mid.Text.ToString()); Guid iMMBD_MaterialID = new Guid(Grid_NewEquipSpare.DataKeys[item.RowIndex].Value.ToString()); string condition = "and x.EMT_ID='" + eMT_ID + "' and b.IMMBD_MaterialID='" + iMMBD_MaterialID + "'"; DataSet ds = equipNameModelL.Search_EquipFreqUsedSpareInfo(condition); //DataTable dt = ds.Tables[0]; //string d = Convert.ToString( dt.Rows[0][0]); //if (!(ds.Tables.Count == 1 && ds.Tables[0].Rows.Count == 0))// have a check 若有一条相同的,就提示,其余不同的则添加。 //{ // ScriptManager.RegisterClientScriptBlock(UpdatePanel_NewSpare, this.GetType(), "aa", "alert('系统中已有该设备的备件,不能重复选择!')", true); //} if (!(ds.Tables[0].Rows.Count == 0))// have a check 若有一条相同的,就提示,其余不同的也不添加。 { ScriptManager.RegisterClientScriptBlock(UpdatePanel_NewSpare, GetType(), "aa", "alert('系统中已有该设备的备件,不能重复选择!')", true); return; } else { equipNameModelL.Insert_EquipFreqUsedSpareInfo(eMT_ID, iMMBD_MaterialID); //string condition = "and x.EMT_ID='eMT_ID'"; BindGrid_EquipSpare("and x.EMT_ID='" + eMT_ID + "'"); //this.UpdatePanel_Spare.Update(); UpdatePanel_NewSpare.Update(); } } } }
protected void Close_spare_Click(object sender, EventArgs e) { Panel_Spare.Visible = false; Panel_NewSpare.Visible = false; UpdatePanel_NewSpare.Update(); //this.UpdatePanel_Spare.Update(); }
protected void New_spare_Click(object sender, EventArgs e) { Clear(); Panel_NewSpare.Visible = true; UpdatePanel_NewSpare.Visible = true; string condition = ""; BindGrid_NewEquipSpare(condition); //addspareequipname.Text = this.Label_enname.Text; //addspareequipmadel.Text = this.Label_mname.Text; UpdatePanel_NewSpare.Update(); }
protected void Clear_spare_Click(object sender, EventArgs e) { TextMaterialName.Text = ""; TextMaterialCode.Text = ""; TextSpecificationModel.Text = ""; BindGrid_EquipSpare("and x.EMT_ID='" + Label_mid.Text.ToString() + "'"); Panel_NewName.Visible = false; UpdatePanel_NewName.Update(); Panel_NewModel.Visible = false; UpdatePanel_NewModel.Update(); Panel_NewSpare.Visible = false; UpdatePanel_NewSpare.Update(); }
protected void Close_model_Click(object sender, EventArgs e) { Panel_NewName.Visible = false; UpdatePanel_NewName.Update(); Panel_Model.Visible = false; Panel_NewModel.Visible = false; UpdatePanel_NewModel.Update(); Panel_Spare.Visible = false; Panel_NewSpare.Visible = false; UpdatePanel_NewSpare.Update(); Panel1.Visible = false; UpdatePanel1.Update(); }
protected void Search_spare_Click(object sender, EventArgs e) { Panel_NewName.Visible = false; UpdatePanel_NewName.Update(); Panel_NewModel.Visible = false; UpdatePanel_NewModel.Update(); Panel_NewSpare.Visible = false; UpdatePanel_NewSpare.Update(); string condition = GetCondition(); BindGrid_EquipSpare(condition); Panel_Spare.Visible = true; //this.UpdatePanel_Spare.Update(); }
//显示编辑设备型号状态 protected void Grid_EquipModel_RowEditing(object sender, GridViewEditEventArgs e) { Panel_NewName.Visible = false; UpdatePanel_NewName.Update(); Panel_NewModel.Visible = false; UpdatePanel_NewModel.Update(); Panel_Spare.Visible = false; Panel_NewSpare.Visible = false; UpdatePanel_NewSpare.Update(); Grid_EquipModel.EditIndex = e.NewEditIndex; string condition = GetCondition3(); BindGrid_EquipModel(condition); }
protected void New_model_Click(object sender, EventArgs e) { Clear(); Panel_Spare.Visible = false; Panel_NewSpare.Visible = false; UpdatePanel_NewSpare.Update(); Panel_NewModel.Visible = true; UpdatePanel_NewModel.Visible = true; TextBox1.Text = Label_enname.Text; UpdatePanel_NewModel.Update(); Panel1.Visible = false; UpdatePanel1.Update(); Grid_EquipModel.EditIndex = -1; BindGrid_EquipModel("and EN_ID ='" + new Guid(Label_enid.Text.ToString()) + "'"); }
protected void Clear_model_Click(object sender, EventArgs e) { Grid_EquipModel.EditIndex = -1; Panel_NewName.Visible = false; UpdatePanel_NewName.Update(); Panel_NewModel.Visible = false; UpdatePanel_NewModel.Update(); Panel_Spare.Visible = false; Panel_NewSpare.Visible = false; UpdatePanel_NewSpare.Update(); Txtmodel.Text = ""; BindGrid_EquipModel("and EN_ID ='" + new Guid(Label_enid.Text.ToString()) + "'"); Panel1.Visible = false; UpdatePanel1.Update(); }
//显示编辑设备名称状态 protected void Grid_EquipName_RowEditing(object sender, GridViewEditEventArgs e) { Panel_NewName.Visible = false; UpdatePanel_NewName.Update(); Panel_Model.Visible = false; Panel_NewModel.Visible = false; UpdatePanel_NewModel.Update(); Panel_Spare.Visible = false; Panel_NewSpare.Visible = false; UpdatePanel_NewSpare.Update(); Panel1.Visible = false; UpdatePanel1.Update(); Grid_EquipName.EditIndex = e.NewEditIndex; BindGrid_EquipName("and EN_EquipName like '%" + Txtname.Text.ToString() + "%'"); }
protected void Grid_EquipSpare_RowCommand(object sender, GridViewCommandEventArgs e) { Panel_NewSpare.Visible = false; UpdatePanel_NewSpare.Update(); if (e.CommandName == "Delete_Spare") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Grid_EquipSpare.SelectedIndex = row.RowIndex; Guid EMT_ID = new Guid(Label_mid.Text.ToString()); Guid EFUS_ID = new Guid(Convert.ToString(e.CommandArgument)); equipNameModelL.Delete_EquipFreqUsedSpareInfo(EMT_ID, EFUS_ID); string condition = " AND x.EMT_ID='" + EMT_ID + "'"; BindGrid_EquipSpare(condition); //this.UpdatePanel_Spare.Update(); } }
protected void New_name_Click(object sender, EventArgs e) { Grid_EquipName.EditIndex = -1; Grid_EquipName.SelectedIndex = -1; BindGrid_EquipName(""); UpdatePanel_Name.Update(); Clear(); Panel_NewName.Visible = true; UpdatePanel_NewName.Update(); Panel_Model.Visible = false; Panel_NewModel.Visible = false; UpdatePanel_NewModel.Update(); Panel_Spare.Visible = false; Panel_NewSpare.Visible = false; UpdatePanel_NewSpare.Update(); Panel1.Visible = false; UpdatePanel1.Update(); }
protected void Search_model_Click(object sender, EventArgs e) { Grid_EquipModel.EditIndex = -1; Panel_NewName.Visible = false; UpdatePanel_NewName.Update(); Panel_NewModel.Visible = false; UpdatePanel_NewModel.Update(); Panel_Spare.Visible = false; Panel_NewSpare.Visible = false; UpdatePanel_NewSpare.Update(); Guid eN_ID = new Guid(Label_enid.Text.ToString()); string condition = GetCondition3(); Grid_EquipModel.DataSource = equipNameModelL.Search_EquipModelTableInfo(condition); Grid_EquipModel.DataBind(); Panel1.Visible = false; UpdatePanel1.Update(); }
protected void Grid_EquipName_RowCommand(object sender, GridViewCommandEventArgs e) { Panel_NewName.Visible = false; UpdatePanel_NewName.Update(); Panel_NewModel.Visible = false; UpdatePanel_NewModel.Update(); Panel_Spare.Visible = false; Panel_NewSpare.Visible = false; UpdatePanel_NewSpare.Update(); if (e.CommandName == "Look_Model")//点击查看设备型号 { Clear(); GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Grid_EquipName.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]; Label_enid.Text = eN_ID; string enname = al[1]; Label_enname.Text = enname; Panel_Model.Visible = true; Label_enname0.Text = Label_enname.Text; BindGrid_EquipModel(" and EN_ID='" + eN_ID + "'"); Panel1.Visible = false; UpdatePanel1.Update(); Grid_EquipName.EditIndex = -1; BindGrid_EquipName(""); UpdatePanel_Name.Update(); } if (e.CommandName == "Delete_Name") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Grid_EquipName.SelectedIndex = row.RowIndex; Guid eN_ID = new Guid(Convert.ToString(e.CommandArgument)); Label_enid.Text = Convert.ToString(eN_ID); equipNameModelL.Delete_EquipNameInfo(eN_ID); BindGrid_EquipName(""); UpdatePanel_Name.Update(); } }
//检索设备名称 protected void Search_name_Click(object sender, EventArgs e) { Grid_EquipName.EditIndex = -1; string condition = GetCondition2(); Grid_EquipName.DataSource = equipNameModelL.Search_EquipNameInfo(condition); Grid_EquipName.DataBind(); UpdatePanel_Name.Update(); Panel_NewName.Visible = false; UpdatePanel_NewName.Update(); Panel_Model.Visible = false; Panel_NewModel.Visible = false; UpdatePanel_NewModel.Update(); Panel_Spare.Visible = false; Panel_NewSpare.Visible = false; UpdatePanel_NewSpare.Update(); Panel1.Visible = false; UpdatePanel1.Update(); }
protected void Grid_EquipModel_RowCommand(object sender, GridViewCommandEventArgs e) { Panel_NewName.Visible = false; UpdatePanel_NewName.Update(); Panel_NewModel.Visible = false; UpdatePanel_NewModel.Update(); Panel_NewSpare.Visible = false; UpdatePanel_NewSpare.Update(); if (e.CommandName == "Look_Spare")//点击查看设备型号 { //this.Label_enid.Text = Convert.ToString(e.CommandArgument); //string eN_ID = e.CommandArgument.ToString(); GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Grid_EquipModel.SelectedIndex = row.RowIndex; Grid_EquipModel.EditIndex = -1; BindGrid_EquipModel("and EN_ID ='" + new Guid(Label_enid.Text.ToString()) + "'"); Clear(); string[] al = e.CommandArgument.ToString().Split(new char[] { ',' }); string eMT_ID = al[0]; Label_mid.Text = eMT_ID; string eMT_Type = al[1]; Label_mname.Text = eMT_Type; Panel_Spare.Visible = true; Label_enname1.Text = Label_enname.Text; Label_mname1.Text = Label_mname.Text; string condition = " AND x.EMT_ID='" + eMT_ID + "'"; BindGrid_EquipSpare(condition); Panel1.Visible = false; UpdatePanel1.Update(); } if (e.CommandName == "Delete_Model") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Grid_EquipModel.SelectedIndex = row.RowIndex; Guid EN_ID = new Guid(Label_enid.Text.ToString()); Guid EMT_ID = new Guid(Convert.ToString(e.CommandArgument)); equipNameModelL.Delete_EquipModelTableInfo(EN_ID, EMT_ID); BindGrid_EquipModel("and EN_ID='" + Label_enid.Text.ToString() + "'"); //this.UpdatePanel_Model.Update(); } }
protected void Clear_name_Click(object sender, EventArgs e) { Grid_EquipName.EditIndex = -1; Txtname.Text = ""; UpdatePanel_Searchname.Update(); BindGrid_EquipName(""); UpdatePanel_Name.Update(); Panel_NewName.Visible = false; UpdatePanel_NewName.Update(); Panel_Model.Visible = false; Panel_NewModel.Visible = false; UpdatePanel_NewModel.Update(); Panel_Spare.Visible = false; Panel_NewSpare.Visible = false; UpdatePanel_NewSpare.Update(); Panel1.Visible = false; UpdatePanel1.Update(); ; }