public List <SalaryDetailDTO> GetAllSalaryDetail(SalaryDetailGetDTO objSalary)
        {
            List <SalaryDetailDTO> salary = new List <SalaryDetailDTO>();

            using (DataBaseLayer dbLayer = new DataBaseLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spSelectSalaryDetail");
                SqlCmd.CommandType = CommandType.StoredProcedure;
                SqlCmd.Parameters.AddWithValue("@ActionBy", 1001);
                salary = dbLayer.GetEntityList <SalaryDetailDTO>(SqlCmd);
            }
            return(salary);
        }
        public List <SalaryDetailDTO> GetInActiveSalaryDetail(SalaryDetailGetDTO objSalary)
        {
            List <SalaryDetailDTO> InActiveList = new List <SalaryDetailDTO>();

            using (DataBaseLayer dbLayer = new DataBaseLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spSelectSalaryDetail");
                SqlCmd.CommandType = CommandType.StoredProcedure;
                SqlCmd.Parameters.AddWithValue("@Active", 0);
                SqlCmd.Parameters.AddWithValue("@ActionBy", objSalary.ActionBy);
                InActiveList = dbLayer.GetEntityList <SalaryDetailDTO>(SqlCmd);
            }
            return(InActiveList);
        }
        public List <SalaryDetailDTO> GetSalaryDetailById(SalaryDetailGetDTO objSalary)
        {
            List <SalaryDetailDTO> accounts = new List <SalaryDetailDTO>();

            using (DataBaseLayer dbLayer = new DataBaseLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spSelectSalaryDetail");
                SqlCmd.CommandType = CommandType.StoredProcedure;
                SqlCmd.Parameters.AddWithValue("@EmployeeId", objSalary.EmployeeId);
                SqlCmd.Parameters.AddWithValue("@ActionBy", objSalary.ActionBy);
                accounts = dbLayer.GetEntityList <SalaryDetailDTO>(SqlCmd);
            }
            return(accounts);
        }
Exemple #4
0
        public HttpResponseMessage GetActiveSalaryDetail(SalaryDetailGetDTO objSalary)
        {
            HttpResponseMessage message;

            try
            {
                SalaryDetailDataAccessLayer dal = new SalaryDetailDataAccessLayer();
                var dynObj = new { result = dal.GetActiveSalaryDetail(objSalary) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynObj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Something wrong. Try Again!" });

                ErrorLog.CreateErrorMessage(ex, "SalaryDetail", "GetActiveSalaryDetail");
            }
            return(message);
        }