Exemple #1
0
 //操作Gridview的命令行
 protected void Grid_Risk_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Edt_RiskLevel")
     {
         GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
         Grid_Risk.SelectedIndex      = row.RowIndex;
         LblSearchCond.Text           = "RiskAll";
         LblGridMaterial.Text         = "该风险等级下物料";
         Panel_SearchMaterial.Visible = true;
         Panel_GridMaterial.Visible   = true;
         GridViewRow gvr = ((GridViewRow)(((LinkButton)(e.CommandSource)).Parent.Parent));
         //this.Grid_BDOrgSheet_1.Rows[gvr.RowIndex].BackColor = System.Drawing.Color.SkyBlue;
         //Session["index"] = gvr.RowIndex;
         idR = new Guid(e.CommandArgument.ToString());
         BindGridMRisk(idR);
         TxtMaterialType.Text  = "";
         TextMaterialName.Text = "";
         UpdatePanel_SearchMaterial.Update();
         UpdatePanel_GridMaterial.Update();
     }
     if (e.CommandName == "Delete_RiskLevel")
     {
         GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
         Grid_Risk.SelectedIndex = row.RowIndex;
         Guid guid = new Guid(e.CommandArgument.ToString());
         hSFBasicDataL.Delete_ExpSampleType(guid);
         BindGridviewRisk(BindcR);
         UpdatePanel_GridRisk.Update();
     }
 }
Exemple #2
0
 //维护窗口提交按钮
 protected void BtnOK_NewRisk_Click(object sender, EventArgs e)
 {
     if (TxtNewRisk.Text == "")
     {
         ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('请输入风险等级!')", true);
         return;
     }
     try
     {
         if (hSFBasicDataL.Insert_HSFReskLevel(TxtNewRisk.Text) <= 0)
         {
             ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('该风险等级已经存在!')", true);
             return;
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('编辑失败!" + ex + "')", true);
         return;
     }
     ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('新增成功!')", true);
     TxtNewRisk.Text = "";
     BindcR          = "";
     BindGridviewRisk(BindcR);
     Panel_NewRisk.Visible = false;
     UpdatePanel_NewRisk.Update();
     UpdatePanel_GridRisk.Update();
 }
Exemple #3
0
 //重置
 protected void BtnResetRisk_Click(object sender, EventArgs e)
 {
     TxtRiskLevel.Text = "";
     UpdatePanel_RiskLevel.Update();
     BindcR = "";
     BindGridviewRisk(BindcR);
     UpdatePanel_GridRisk.Update();
 }
Exemple #4
0
 //检索栏检索按钮
 protected void BtnSearchRisk_Click(object sender, EventArgs e)
 {
     BindcR = TxtRiskLevel.Text;
     BindGridviewRisk(BindcR);
     UpdatePanel_GridRisk.Update();
 }