Пример #1
0
        protected void btnSave6_Click(object sender, EventArgs e)
        {
            PS_POSI_AND_SALARY PosiSalary = new PS_POSI_AND_SALARY();

            PosiSalary.UOC_ID          = Int32.Parse(MyCrypto.GetDecryptedQueryString(Request.QueryString["id"].ToString()));
            PosiSalary.START_DATE      = DateTime.Parse(tbStartDate14.Text);
            PosiSalary.PAS_NAME        = tbName14.Text;
            PosiSalary.NO_POSITION     = tbNoPosition14.Text;
            PosiSalary.POSITION_TYPE   = tbPosiType14.Text;
            PosiSalary.POSITION_DEGREE = tbPosiDegree14.Text;
            PosiSalary.SALARY          = Convert.ToInt32(tbSalary14.Text);
            PosiSalary.POSITION_SALARY = Convert.ToInt32(tbPosiSalary14.Text);
            PosiSalary.REF_DOC         = tbRefDoc14.Text;
            PosiSalary.INSERT_PS_POSI_AND_SALARY();

            PS_PERSON P0         = new PS_PERSON();
            int       salary     = DatabaseManager.ExecuteInt("SELECT * FROM (SELECT salary FROM PS_POSI_AND_SALARY ORDER BY START_DATE DESC) WHERE ROWNUM = 1");
            int       posisalary = DatabaseManager.ExecuteInt("SELECT * FROM (SELECT position_salary FROM PS_POSI_AND_SALARY ORDER BY START_DATE DESC) WHERE ROWNUM = 1");

            P0.SALARY          = salary.ToString();
            P0.POSITION_SALARY = posisalary.ToString();
            P0.UOC_ID          = Int32.Parse(MyCrypto.GetDecryptedQueryString(Request.QueryString["id"].ToString()));
            P0.UPDATE_CURRENT_SALARY_PERSON();

            ClearPositionAndSalary();
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('เพิ่มข้อมูลเรียบร้อย')", true);
            BindData();
        }
Пример #2
0
        protected void modDeleteCommand5(Object sender, GridViewDeleteEventArgs e)
        {
            int id = Convert.ToInt32(GridViewPosiSalary.DataKeys[e.RowIndex].Value);
            PS_POSI_AND_SALARY PStudy = new PS_POSI_AND_SALARY();

            PStudy.PAS_ID = id;
            PStudy.DELETE_PS_POSI_AND_SALARY();

            PS_PERSON P0         = new PS_PERSON();
            int       salary     = DatabaseManager.ExecuteInt("SELECT * FROM (SELECT salary FROM PS_POSI_AND_SALARY ORDER BY START_DATE DESC) WHERE ROWNUM = 1");
            int       posisalary = DatabaseManager.ExecuteInt("SELECT * FROM (SELECT position_salary FROM PS_POSI_AND_SALARY ORDER BY START_DATE DESC) WHERE ROWNUM = 1");

            P0.SALARY          = salary.ToString();
            P0.POSITION_SALARY = posisalary.ToString();
            P0.UOC_ID          = Int32.Parse(MyCrypto.GetDecryptedQueryString(Request.QueryString["id"].ToString()));
            P0.UPDATE_CURRENT_SALARY_PERSON();

            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('ลบข้อมูลเรียบร้อย')", true);

            GridViewPosiSalary.EditIndex = -1;
            BindData();
        }