예제 #1
0
 protected void BtnFind_Click(object sender, EventArgs e)
 {
     if (txtDesigCode.Text != "" && txtDesigName.Text == "")
     {
         clsDesig des = clsDesigManager.getDesig(txtDesigCode.Text);
         if (des != null)
         {
             txtDesigCode.Text               = des.DesigCode;
             txtDesigName.Text               = des.DesigName;
             txtDesigAbb.Text                = des.DesigAbb;
             ddlClass.SelectedValue          = des.Class;
             ddlGradeCode.SelectedValue      = des.GradeCode;
             ddlMgrCode.SelectedValue        = des.MgrCode;
             ddlOfficerOrStaff.SelectedValue = des.OfficerStaff;
             ddlTectNtech.SelectedValue      = des.TechNtech;
         }
         else
         {
             ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('No data found!!');", true);
         }
     }
     else if (txtDesigCode.Text == "" && txtDesigName.Text != "")
     {
         DataTable dt = clsDesigManager.getDesigDetails(txtDesigName.Text);
         dgDesig.DataSource = dt;
         dgDesig.DataBind();
     }
     else
     {
         ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Please select designation ID or name first!!');", true);
     }
 }
예제 #2
0
        public static void UpdateDesig(clsDesig des)
        {
            String connectionString = DataManager.OraConnString();
            string query            = " update pmis_desig_code set desig_name= '" + des.DesigName + "',desig_abb= '" + des.DesigAbb + "',mgr_code= '" + des.MgrCode + "', " +
                                      " grade_code= '" + des.GradeCode + "',tech_ntech= '" + des.TechNtech + "',class= '" + des.Class + "',officer_staff= '" + des.OfficerStaff + "' " +
                                      " where desig_code= '" + des.DesigCode + "'";

            DataManager.ExecuteNonQuery(connectionString, query);
        }
예제 #3
0
        public static void CreateDesig(clsDesig des)
        {
            String connectionString = DataManager.OraConnString();
            string query            = " insert into pmis_desig_code (desig_code,desig_name,desig_abb,mgr_code,grade_code,tech_ntech,class,officer_staff) values (" +
                                      " " + " '" + des.DesigCode + "'," + " '" + des.DesigName + "'," + " '" + des.DesigAbb + "'," + " '" + des.MgrCode + "', " +
                                      " " + " '" + des.GradeCode + "'," + " '" + des.TechNtech + "'," + " '" + des.Class + "'," + " '" + des.OfficerStaff + "' )";

            DataManager.ExecuteNonQuery(connectionString, query);
        }
예제 #4
0
    protected void dgDesig_SelectedIndexChanged(object sender, EventArgs e)
    {
        clsDesig des = clsDesigManager.getDesig(dgDesig.SelectedRow.Cells[1].Text.Trim());

        if (des != null)
        {
            txtDesigCode.Text               = des.DesigCode;
            txtDesigName.Text               = des.DesigName;
            txtDesigAbb.Text                = des.DesigAbb;
            ddlClass.SelectedValue          = des.Class;
            ddlGradeCode.SelectedValue      = des.GradeCode;
            ddlMgrCode.SelectedValue        = des.MgrCode;
            ddlOfficerOrStaff.SelectedValue = des.OfficerStaff;
            ddlTectNtech.SelectedValue      = des.TechNtech;
        }
    }
예제 #5
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        clsDesig des = clsDesigManager.getDesig(txtDesigCode.Text);

        if (des != null)
        {
            des.DesigName    = txtDesigName.Text;
            des.DesigAbb     = txtDesigAbb.Text;
            des.Class        = ddlClass.SelectedValue;
            des.GradeCode    = ddlGradeCode.SelectedValue;
            des.MgrCode      = ddlMgrCode.SelectedValue;
            des.OfficerStaff = ddlOfficerOrStaff.SelectedValue;
            des.TechNtech    = ddlTectNtech.SelectedValue;
            clsDesigManager.UpdateDesig(des);
            DataTable dt = clsDesigManager.getDesigDetails("");
            dgDesig.DataSource = dt;
            dgDesig.DataBind();
            ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Record updated successfully!!');", true);
        }
        else
        {
            des              = new clsDesig();
            des.DesigName    = txtDesigName.Text;
            des.DesigAbb     = txtDesigAbb.Text;
            des.Class        = ddlClass.SelectedValue;
            des.GradeCode    = ddlGradeCode.SelectedValue;
            des.MgrCode      = ddlMgrCode.SelectedValue;
            des.OfficerStaff = ddlOfficerOrStaff.SelectedValue;
            des.TechNtech    = ddlTectNtech.SelectedValue;
            des.DesigCode    = IdManager.GetNextID("pmis_desig_code", "desig_code").ToString();
            clsDesigManager.CreateDesig(des);
            DataTable dt = clsDesigManager.getDesigDetails("");
            dgDesig.DataSource = dt;
            dgDesig.DataBind();
            ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Record inserted successfully!!');", true);
        }
    }