예제 #1
0
    //新增确认
    protected void BtnOK_NewCDDep_Click(object sender, EventArgs e)
    {
        if (newCDdep.Text.ToString() == "" || newCDcode.Text.ToString() == "")
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true);
            return;
        }
        //string bDOS_Name = this.DropDownList4.SelectedValue.ToString();
        string cDDDCT_Dep  = newCDdep.Text.ToString();
        string cDDDCT_Code = newCDcode.Text.ToString();
        //DataSet ds = basicCodeL.Search_BDOrganization_depcode("and BDOS_Name = '" + bDOS_Name + "' and BDOS_DepCode!=''");
        DataSet   ds = basicCodeL.Search_CDDepDistributeCodeT(" and (a.CDDDCT_Code='" + cDDDCT_Code + "' or a.CDDDCT_Dep='" + cDDDCT_Dep + "')");
        DataTable dt = ds.Tables[0];

        if (dt.Rows.Count != 0)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('已有代码,不能重复!')", true);
            return;
        }
        basicCodeL.Insert_CDDepDistributeCodeT(cDDDCT_Dep, cDDDCT_Code);
        BindGrid_CDDep("");
        UpdatePanel_CDDep.Update();
        Panel_NewCDDep.Visible = false;
        UpdatePanel_NewCDDep.Update();
    }
예제 #2
0
    //显示编辑
    protected void Grid_CDDep_RowEditing(object sender, GridViewEditEventArgs e)
    {
        Panel_NewCDDep.Visible = false;
        UpdatePanel_NewCDDep.Update();
        Grid_CDDep.EditIndex = e.NewEditIndex;
        string condition = GetCondition2();

        BindGrid_CDDep(condition);
    }
예제 #3
0
 protected void Btn_NewCDDep_Click(object sender, EventArgs e)
 {
     Grid_CDDep.EditIndex     = -1;
     Grid_CDDep.SelectedIndex = -1;
     BindGrid_CDDep("");
     UpdatePanel2.Update();
     Clear();
     //BindDropDownList4();
     Panel_NewCDDep.Visible = true;
     UpdatePanel_NewCDDep.Update();
 }
예제 #4
0
    protected void Btn_SearchCDDep_Click(object sender, EventArgs e)
    {
        Grid_CDDep.EditIndex = -1;
        string condition = GetCondition2();

        BindGrid_CDDep(condition);
        Panel_CDDep.Visible = true;
        UpdatePanel_CDDep.Update();
        Panel_NewCDDep.Visible = false;
        UpdatePanel_NewCDDep.Update();
    }
예제 #5
0
 protected void Btn_ClearCDDep_Click(object sender, EventArgs e)
 {
     Grid_CDDep.EditIndex = -1;
     //DropDownList3.Items.Insert(0, new ListItem("请选择", ""));
     //BindDropDownList3();
     TextDep.Text  = "";
     TextCode.Text = "";
     BindGrid_CDDep("");
     UpdatePanel_CDDep.Update();
     Panel_NewCDDep.Visible = false;
     UpdatePanel_NewCDDep.Update();
 }
예제 #6
0
    //Gridview删除
    protected void Grid_CDDep_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        Panel_NewCDDep.Visible = false;
        UpdatePanel_NewCDDep.Update();
        if (e.CommandName == "Delete_CDDep")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            Grid_BDOS.SelectedIndex = row.RowIndex;

            Guid CDDDCT_ID = new Guid(Convert.ToString(e.CommandArgument));
            basicCodeL.Delete_CDDepDistributeCodeT(CDDDCT_ID);
            BindGrid_CDDep("");
            UpdatePanel_CDDep.Update();
        }
    }
예제 #7
0
 //新增取消
 protected void BtnCancel_NewCDDep_Click(object sender, EventArgs e)
 {
     Panel_NewCDDep.Visible = false;
     UpdatePanel_NewCDDep.Update();
 }