예제 #1
0
        //public DataSet AttendancePopup(AttendancePopup Popup)
        //{
        //    DataSet result;
        //    SqlCommand SqlCmd = new SqlCommand("spAttendanceReport");
        //    SqlCmd.CommandType = CommandType.StoredProcedure;
        //    SqlCmd.Parameters.AddWithValue("@ManpowerId", Popup.ManpowerId);
        //    SqlCmd.Parameters.AddWithValue("@FromDate", Popup.FromDate);
        //    SqlCmd.Parameters.AddWithValue("@ToDate", Popup.ToDate);
        //    SqlCmd.Parameters.AddWithValue("@ActionBy", Popup.ActionBy);
        //    result = _unitOfWork.fillDataSet(SqlCmd);
        //    return result;
        //}

        public List <ManpowerAttendanceCustomerAllDTO> GetAllCustomer(ManpowerAttendanceCustomerDTO objCustomer)
        {
            List <ManpowerAttendanceCustomerAllDTO> customer = new List <ManpowerAttendanceCustomerAllDTO>();

            using (DbLayer dbLayer = new DbLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spSelectAllocateManpower");
                SqlCmd.CommandType = CommandType.StoredProcedure;
                SqlCmd.Parameters.AddWithValue("@CompanyId", objCustomer.CompanyId);
                SqlCmd.Parameters.AddWithValue("@ActionBy", objCustomer.ActionBy);
                customer = dbLayer.GetEntityList <ManpowerAttendanceCustomerAllDTO>(SqlCmd);
            }
            return(customer);
        }
        public HttpResponseMessage getAllCustomer(ManpowerAttendanceCustomerDTO customer)
        {
            HttpResponseMessage message;

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

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