예제 #1
0
    protected void BtnOK_NewModel_Click(object sender, EventArgs e)
    {
        if (NewModel.Text.ToString() == "" || TextBox2.Text.ToString() == "" || TextBox3.Text.ToString() == "")
        {
            ScriptManager.RegisterClientScriptBlock(UpdatePanel_NewModel, GetType(), "alert", "alert('标记*的为必填项,请填写完整!')", true);
            return;
        }
        Guid      eN_ID            = new Guid(Label_enid.Text.ToString());
        string    eMT_Type         = NewModel.Text.ToString();
        Guid      iMMBD_MaterialID = new Guid(Label99.Text.ToString());
        DataSet   ds = equipNameModelL.Search_EquipModelTableInfo("and EN_ID='" + eN_ID + "' and EMT_Type='" + eMT_Type + "'");
        DataTable dt = ds.Tables[0];

        if (dt.Rows.Count != 0)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('系统中已有该设备型号,不能重名!')", true);
            return;
        }
        eMEquipName_EMEquipModelTableInfo.EN_ID            = eN_ID;
        eMEquipName_EMEquipModelTableInfo.EMT_Type         = eMT_Type;
        eMEquipName_EMEquipModelTableInfo.IMMBD_MaterialID = iMMBD_MaterialID;
        equipNameModelL.Insert_EquipModelTableInfo(eMEquipName_EMEquipModelTableInfo);
        //BindGrid_EquipModel(Convert.ToString(eN_ID));
        BindGrid_EquipModel("and EN_ID ='" + eN_ID + "'");
        Panel_NewModel.Visible = false;
        UpdatePanel_NewModel.Update();
        Panel1.Visible = false;
        UpdatePanel1.Update();
    }
예제 #2
0
    protected void Button4_Click(object sender, EventArgs e)
    {
        GridView1.SelectedIndex = -1;
        bool temp = false;

        foreach (GridViewRow item in GridView1.Rows)
        {
            RadioButton rb = item.FindControl("RadioButtonMarkup") as RadioButton;

            if (rb.Checked)
            {
                Guid iMMBD_MaterialID = new Guid(GridView1.DataKeys[item.RowIndex].Value.ToString());
                Label99.Text   = iMMBD_MaterialID.ToString();
                TextBox2.Text  = GridView1.Rows[item.RowIndex].Cells[2].Text.ToString();
                TextBox3.Text  = GridView1.Rows[item.RowIndex].Cells[3].Text.ToString();
                temp           = true;
                Panel1.Visible = false;
                UpdatePanel1.Update();
                UpdatePanel_NewModel.Update();
            }
        }
        if (!temp)
        {
            ScriptManager.RegisterClientScriptBlock(UpdatePanel1, GetType(), "alert", "alert('请选择物料信息!')", true);
            return;
        }
    }
예제 #3
0
 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();
 }
예제 #4
0
 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();
 }
예제 #5
0
    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();
    }
예제 #6
0
    //显示编辑设备型号状态
    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);
    }
예제 #7
0
 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()) + "'");
 }
예제 #8
0
 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();
 }
예제 #9
0
    //显示编辑设备名称状态
    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() + "%'");
    }
예제 #10
0
    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();
    }
예제 #11
0
 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();
 }
예제 #12
0
    //检索设备名称
    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();
    }
예제 #13
0
    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();
        }
    }
예제 #14
0
    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();
        }
    }
예제 #15
0
 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();
     ;
 }