Example #1
0
 protected void Search_name_Click(object sender, EventArgs e)
 {
     Grid_EquipName.DataSource = equipNameModelL.Search_EquipNameInfo("and EN_EquipName like '%" + Textnameadd.Text.ToString() + "%'");
     Grid_EquipName.DataBind();
     Panel_New.Visible = false;
     UpdatePanel_New.Update();
 }
Example #2
0
 protected void Clear_name_Click(object sender, EventArgs e)
 {
     Textnameadd.Text          = "";
     Grid_EquipName.DataSource = equipNameModelL.Search_EquipNameInfo("");
     Grid_EquipName.DataBind();
     Panel_New.Visible = false;
     UpdatePanel_New.Update();
 }
Example #3
0
    //显示编辑状态
    protected void Grid_EquipUpkeepItem_RowEditing(object sender, GridViewEditEventArgs e)
    {
        Grid_EquipUpkeepItem.EditIndex = e.NewEditIndex;
        string condition = GetCondition();

        BindGrid_EquipUpkeepItem(condition);
        Panel_searchname.Visible = false;
        Panel_New.Visible        = false;
        UpdatePanel_New.Update();
    }
Example #4
0
    protected void Btn_Search_Click(object sender, EventArgs e)
    {
        Grid_EquipUpkeepItem.EditIndex = -1;
        string condition = GetCondition();

        BindGrid_EquipUpkeepItem(condition);
        Panel_Item.Visible = true;
        UpdatePanel_Item.Update();
        Panel_searchname.Visible = false;
        Panel_New.Visible        = false;
        UpdatePanel_New.Update();
    }
Example #5
0
 protected void Btn_New_Click(object sender, EventArgs e)
 {
     Grid_EquipUpkeepItem.EditIndex = -1;
     BindGrid_EquipUpkeepItem("");
     UpdatePanel_Item.Update();
     Clear();
     Panel_searchname.Visible       = true;
     UpdatePanel_searchname.Visible = true;
     Grid_EquipName.DataSource      = equipNameModelL.Search_EquipNameInfo("");
     Grid_EquipName.DataBind();
     Panel_New.Visible = false;
     UpdatePanel_New.Update();
 }
Example #6
0
 protected void Btn_Clear_Click(object sender, EventArgs e)
 {
     Grid_EquipUpkeepItem.EditIndex = -1;
     Textname.Text   = "";
     Textitems.Text  = "";
     Textperiod.Text = "";
     UpdatePanel_Search.Update();
     BindGrid_EquipUpkeepItem("");
     UpdatePanel_Item.Update();
     Panel_searchname.Visible = false;
     Panel_New.Visible        = false;
     UpdatePanel_New.Update();
 }
Example #7
0
    //Gridview删除
    protected void Grid_EquipUpkeepItem_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        Panel_searchname.Visible = false;
        Panel_New.Visible        = false;
        UpdatePanel_New.Update();
        if (e.CommandName == "Delete_Item")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            Grid_EquipUpkeepItem.SelectedIndex = row.RowIndex;

            Guid EUI_ID = new Guid(Convert.ToString(e.CommandArgument));
            equipUpkeepItemL.Delete_EquipUpkeepItemInfo(EUI_ID);
            BindGrid_EquipUpkeepItem("");
            UpdatePanel_Item.Update();
        }
    }
Example #8
0
    protected void Grid_EquipName_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        Panel_New.Visible = false;
        UpdatePanel_New.Update();
        if (e.CommandName == "Add_Info")//点击查看设备型号
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            Grid_EquipName.SelectedIndex = row.RowIndex;

            Clear();
            string[] al    = e.CommandArgument.ToString().Split(new char[] { ',' });
            string   EN_ID = al[0];
            Label_nid.Text = EN_ID;
            string EN_EquipName = al[1];
            Label_nname.Text  = EN_EquipName;
            Textaddname.Text  = Label_nname.Text;
            Panel_New.Visible = true;
            UpdatePanel_New.Update();
            //string condition = " AND x.EMT_ID='" + eMT_ID + "'";
            //BindGrid_EquipSpare(condition);
            //this.Panel_Model.Visible = true;
            //this.UpdatePanel_Model.Update();
        }
    }
Example #9
0
    }//重置

    protected void BtnNew_Click(object sender, EventArgs e)
    {
        Panel_New.Visible = true;
        Label4.Text       = "新增";
        //TextBox1.Text = "";
        //TextBox2.Text = "";
        //TextBox3.Text = "";
        //TextBox4.Text = "";
        //TextBox5.Text = "";
        //TextBox6.Text = "";
        //TextBox7.Text = "";
        //TextBox8.Text = "";
        //TextBox9.Text = "";
        TextBox1.Text  = "";
        TextBox11.Text = "";
        TextBox2.Text  = "";

        TextBox12.Text = "";
        TextBox4.Text  = "";
        TextBox3.Text  = "";

        TextBox5.Text = "";
        TextBox6.Text = "";
        TextBox7.Text = "";

        TextBox8.Text = "";
        TextBox9.Text = "";
        DropDownList1.ClearSelection();

        UpdatePanel_New.Update();
        Panel_History.Visible = false;
        Panel_Result.Visible  = false;
        UpdatePanel_Result.Update();
        BindGrid_MeasAppliance("");
        UpdatePanel_History.Update();
    }//新增设备
Example #10
0
 protected void Close_name_Click(object sender, EventArgs e)
 {
     Panel_searchname.Visible = false;
     Panel_New.Visible        = false;
     UpdatePanel_New.Update();
 }
Example #11
0
    }//提交

    protected void BtnCancel1_Click(object sender, EventArgs e)
    {
        Panel_New.Visible = false;
        UpdatePanel_New.Update();
    }//取消
Example #12
0
    protected void BtnOK_Click(object sender, EventArgs e)
    {
        if (TextBox1.Text == "" || TextBox2.Text == "" || TextBox3.Text == "" || TextBox4.Text == "" || TextBox5.Text == "" || TextBox6.Text == "" || TextBox7.Text == "" || TextBox8.Text == "" || TextBox9.Text == "" || TextBox11.Text == "" || TextBox12.Text == "" || DropDownList1.SelectedValue == "")
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true);
            return;
        }

        DateTime din, dready;

        DateTime.TryParse(TextBox4.Text, out din);
        DateTime.TryParse(TextBox8.Text, out dready);
        if (dready < din)
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('待验日期必须大于送达日期!')", true);
            return;
        }


        if (IsMatchInt(TextBox7.Text, 0) == false)
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('检验周期必须是大于0的整数!')", true);
            return;
        }

        if (IsMatchInt(TextBox9.Text, 0) == false)
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('检验提醒天数必须是大于0的整数!')", true);
            return;
        }

        if (TextBox1.Text == "")
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('设备名称不能为空!')", true);
            return;
        }
        else
        {
            measApplianceMan.MAM_EquipName = TextBox1.Text;
        }

        if (TextBox2.Text == "")
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('出厂编号不能为空!')", true);
            return;
        }
        else
        {
            measApplianceMan.MAM_ManuCode = TextBox2.Text;
        }

        if (TextBox3.Text == "")
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('设备位置不能为空!')", true);
            return;
        }
        else
        {
            measApplianceMan.MAM_Location = TextBox3.Text;
        }

        DateTime d1;

        if (DateTime.TryParse(TextBox4.Text, out d1))
        {
            measApplianceMan.MAM_ToDate = d1;
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('请输入正确的送达日期!')", true);
            return;
        }
        if (TextBox5.Text == "")
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('厂家精度不能为空!')", true);
            return;
        }
        else
        {
            measApplianceMan.MAM_OAccuracy = TextBox5.Text;
        }
        if (TextBox6.Text == "")
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('精度要求不能为空!')", true);
            return;
        }
        else
        {
            measApplianceMan.MAM_IAccuracy = TextBox6.Text;
        }
        if (TextBox7.Text == "")
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('检验周期不能为空!')", true);
            return;
        }
        else
        {
            measApplianceMan.MAM_Period = Convert.ToInt32(TextBox7.Text);
        }
        if (measApplianceMan.MAM_Period < 0)
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('检验周期不合法!')", true);
            return;
        }

        DateTime d2;

        if (DateTime.TryParse(TextBox8.Text, out d2))
        {
            measApplianceMan.MAM_ToBeTestDate = d2;
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('请输入正确的待检日期!')", true);
            return;
        }
        if (TextBox9.Text == "")
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('检验提醒天数不能为空!')", true);
            return;
        }
        else
        {
            measApplianceMan.MAM_RemindDays = Convert.ToInt32(TextBox9.Text);
        }
        if (measApplianceMan.MAM_RemindDays < 0)
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('检验提醒天数不合法!')", true);
            return;
        }
        measApplianceMan.MAM_EquipType = TextBox11.Text;
        measApplianceMan.MAM_ManuName  = TextBox12.Text;
        measApplianceMan.MAM_Isunused  = DropDownList1.Text;

        if (Label4.Text == "新增")
        {
            measApplianceL.Insert_MeasApplianceMan(measApplianceMan);
        }
        if (Label4.Text == "编辑")
        {
            measApplianceMan.MAM_EquipID = ID_Edit;
            measApplianceL.Update_MeasApplianceMan(measApplianceMan);
        }

        Panel_New.Visible = false;
        UpdatePanel_New.Update();
        if (BlInto_S_Search == true)
        {
            BindGrid_MeasAppliance(Condition);
        }
        if (BlInto_S_Search == false)
        {
            BindGrid_MeasAppliance("");
        }
        UpdatePanel_Grid.Update();
    }//提交
Example #13
0
 private void UpdatePanel_history_result_new()
 {
     UpdatePanel_History.Update();
     UpdatePanel_Result.Update();
     UpdatePanel_New.Update();
 }