Esempio n. 1
0
        public List <ManpowerAttendanceSiteAllDTO> GetAllSite(ManpowerAttendanceSiteDTO objBranch)
        {
            List <ManpowerAttendanceSiteAllDTO> site = new List <ManpowerAttendanceSiteAllDTO>();

            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("@ActionBy", objBranch.ActionBy);
                site = dbLayer.GetEntityList <ManpowerAttendanceSiteAllDTO>(SqlCmd);
            }
            return(site);
        }
        public HttpResponseMessage getAllSite(ManpowerAttendanceSiteDTO site)
        {
            HttpResponseMessage message;

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

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