Esempio n. 1
0
        public List <ManpowerAttendanceClassificationAllDTO> GetAllClassification(ManpowerAttendanceClassificationDTO objBranch)
        {
            List <ManpowerAttendanceClassificationAllDTO> site = new List <ManpowerAttendanceClassificationAllDTO>();

            using (DbLayer dbLayer = new DbLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spSelectAllocateManpower");
                SqlCmd.CommandType = CommandType.StoredProcedure;
                SqlCmd.Parameters.AddWithValue("@CustomerId", objBranch.CustomerId);
                SqlCmd.Parameters.AddWithValue("@BranchId", objBranch.BranchId);
                SqlCmd.Parameters.AddWithValue("@SiteId", objBranch.SiteId);
                SqlCmd.Parameters.AddWithValue("@ActionBy", objBranch.ActionBy);
                site = dbLayer.GetEntityList <ManpowerAttendanceClassificationAllDTO>(SqlCmd);
            }
            return(site);
        }
        public HttpResponseMessage getAllClassification(ManpowerAttendanceClassificationDTO classification)
        {
            HttpResponseMessage message;

            try
            {
                // ManpowerAttendanceDAL dal = new ManpowerAttendanceDAL();
                var dynObj = new { result = _obj.GetAllClassification(classification) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynObj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Something wrong. Try Again!" });

                ErrorLog.CreateErrorMessage(ex, "ManpowerAttendance", "getAllClassification");
            }
            return(message);
        }