Beispiel #1
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            PayScaleGradeItemEntity grade = new PayScaleGradeItemEntity();
            grade.GradeId = GradeLabel.Text;
            grade.GradeEntry = Convert.ToDouble(GradeEntryTextBox.Text);
            grade.GradeKCB = Convert.ToDouble(GradeKCBTextBox.Text);

            new PayScaleMapper().UpdateGrade(grade, Convert.ToInt32(Request.QueryString["ContractTemplateId"].ToString()), Session["jobCode"].ToString());
            Response.Redirect("PayScale.aspx?ContractTemplateId=" + Request.QueryString["ContractTemplateId"]);
        }
Beispiel #2
0
        public List<PayScaleGradeItemEntity> ListGradesFromPayScale(int contractTemplateId, string jobCode)
        {
            SqlConnection conn = null;
            SqlCommand cmd = null;

            try
            {
                conn = DALHelper.CreateSqlDbConnection();
                cmd = new SqlCommand("usp_ListGradesByContractTemplateIdAndJobCodeFromPayScale", conn);
                cmd.CommandType = System.Data.CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@ContractTemplateId", contractTemplateId);
                cmd.Parameters.AddWithValue("@JobCode", jobCode);

                SqlDataReader rdr = cmd.ExecuteReader();
                List<PayScaleGradeItemEntity> list = new List<PayScaleGradeItemEntity>();

                while (rdr.Read())
                {
                    PayScaleGradeItemEntity view = new PayScaleGradeItemEntity();
                    view.GradeId = Convert.ToString(rdr["GradeId"]);
                    view.GradeEntry = Convert.ToDouble(rdr["GradeEntry"]);
                    view.GradeKCB = Convert.ToDouble(rdr["GradeKCB"]);

                    list.Add(view);
                }

                return list;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                conn.Close();
                cmd.Dispose();
                conn.Dispose();
            }
        }
Beispiel #3
0
        public void UpdateGrade(PayScaleGradeItemEntity t, int contractTemplateId, string jobCode)
        {
            SqlConnection conn = null;
            SqlCommand cmd = null;

            try
            {
                conn = DALHelper.CreateSqlDbConnection();
                cmd = new SqlCommand("usp_UpdatePayScaleGradeItem", conn);
                cmd.CommandType = System.Data.CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@ContractTemplateId", contractTemplateId);
                cmd.Parameters.AddWithValue("@JobCode", jobCode);
                cmd.Parameters.AddWithValue("@GradeId", t.GradeId);
                cmd.Parameters.AddWithValue("@GradeEntry", t.GradeEntry);
                cmd.Parameters.AddWithValue("@GradeKCB", t.GradeKCB);

                cmd.ExecuteNonQuery();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                conn.Close();
                cmd.Dispose();
                conn.Dispose();
            }
        }