Ejemplo n.º 1
0
        public List <SalaryCompensateDTO> GetAllSalaryCompensate(SalaryCompensateGetDTO objSalary)
        {
            List <SalaryCompensateDTO> salary = new List <SalaryCompensateDTO>();

            using (DbLayer dbLayer = new DbLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spSelectSalaryComponent");
                SqlCmd.CommandType = CommandType.StoredProcedure;
                SqlCmd.Parameters.AddWithValue("@ActionBy", objSalary.ActionBy);
                salary = dbLayer.GetEntityList <SalaryCompensateDTO>(SqlCmd);
            }
            return(salary);
        }
Ejemplo n.º 2
0
        public SalaryCompensateDTO GetSalaryCompensateById(SalaryCompensateGetDTO objSalary)
        {
            SalaryCompensateDTO accounts = new SalaryCompensateDTO();

            using (DbLayer dbLayer = new DbLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spSelectSalaryComponent");
                SqlCmd.CommandType = CommandType.StoredProcedure;
                SqlCmd.Parameters.AddWithValue("@Id", objSalary.Id);
                SqlCmd.Parameters.AddWithValue("@ActionBy", objSalary.ActionBy);
                accounts = dbLayer.GetEntityList <SalaryCompensateDTO>(SqlCmd).FirstOrDefault();
            }
            return(accounts);
        }
Ejemplo n.º 3
0
        public HttpResponseMessage GetSalaryComponsateById(SalaryCompensateGetDTO objSalary)
        {
            HttpResponseMessage message;

            try
            {
                SalaryCompensateDataAccessLayer dal = new SalaryCompensateDataAccessLayer();
                var dynObj = new { result = dal.GetSalaryCompensateById(objSalary) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynObj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Somthing wrong, Try Again!" });
                ErrorLog.CreateErrorMessage(ex, "Salary", "GetSalaryById");
            }
            return(message);
        }