コード例 #1
0
        protected void Grid_ppl_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int pindex = Grid_ppl.PageIndex * Grid_ppl.PageSize;

            if (e.CommandName == "DelPPL")
            {
                DataTable    dtppl     = ViewState["CurrentGCEditPPL"] as DataTable;
                int          index     = Convert.ToInt32(e.CommandArgument.ToString()) + pindex;
                OracleQuery2 cc2       = new OracleQuery2();
                string       d         = dtppl.Rows[index]["GROUP_KEY"].ToString();
                string       person_id = dtppl.Rows[index]["EMPLOYEE_id"].ToString();

                string company_id = dtppl.Rows[index]["COMPANY_id"].ToString();
                cc2.DeleteGCPPLFromAllGroup(person_id, company_id);
                BindPPLDetail();
            }
            if (e.CommandName == "EditPPL")
            {
                AddPPLPanel.Visible = true;
                grpPanel.Visible    = true;
                GroupIDINLabel.Text = "";
                DataTable dtppl      = ViewState["CurrentGCEditPPL"] as DataTable;
                int       index      = Convert.ToInt32(e.CommandArgument.ToString()) + pindex;
                string    EmployeeID = dtppl.Rows[index]["EMPLOYEE_ID"].ToString();
                string    Name       = dtppl.Rows[index]["NAME"].ToString();
                string    posname    = dtppl.Rows[index]["POSITION"].ToString();
                string    unitname   = dtppl.Rows[index]["COMPANY"].ToString();
                string    MOBILE     = dtppl.Rows[index]["MOBILE"].ToString();
                string    company_id = dtppl.Rows[index]["company_id"].ToString();
                SetGroup(EmployeeID, company_id);
                EmployeeIDLabel.Text = EmployeeID;
                NameLabel.Text       = Name;
                posnameLabel.Text    = posname;
                // unitnameLabel.Text = unitname;
                companyLabel.Text = company_id;
                TelLabel.Text     = MOBILE;
                OracleQuery2 cc2 = new OracleQuery2();
                DataTable    dt  = cc2.LoadAllGCUnit();
                unitnameList.DataSource     = dt;
                unitnameList.DataTextField  = "COMPANY_NAME";
                unitnameList.DataValueField = "COMPANY_ID";
                unitnameList.DataBind();
                unitnameList.Items.FindByValue(company_id).Selected = true;
                resultppl.Visible   = true;
                SavePPL.Enabled     = true;
                grpPanel.Visible    = true;
                AddPPLPanel.Visible = true;
                HeadModal.Visible   = false;
                UpdatePPL.Visible   = true;
                SavePPL.Visible     = false;
                NoResult.Visible    = false;
            }
        }