Exemplo n.º 1
0
        public List <ShiftMasterDTO> GetAllShifts(ShiftGetDTO objGetShift)
        {
            List <ShiftMasterDTO> ShiftMaster = new List <ShiftMasterDTO>();

            using (DbLayer dbLayer = new DbLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spSelectShift");
                SqlCmd.Parameters.AddWithValue("@ActionBy", objGetShift.ActionBy);
                SqlCmd.CommandType = CommandType.StoredProcedure;
                ShiftMaster        = dbLayer.GetEntityList <ShiftMasterDTO>(SqlCmd);
            }
            return(ShiftMaster);
        }
Exemplo n.º 2
0
        public ShiftMasterDTO GetShiftById(ShiftGetDTO objGetShiftById)
        {
            ShiftMasterDTO ShiftMaster = new ShiftMasterDTO();

            using (DbLayer dbLayer = new DbLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spSelectShift");
                SqlCmd.CommandType = CommandType.StoredProcedure;
                SqlCmd.Parameters.AddWithValue("@ShiftId", objGetShiftById.ShiftId);
                SqlCmd.Parameters.AddWithValue("@ActionBy", objGetShiftById.ActionBy);
                ShiftMaster = dbLayer.GetEntityList <ShiftMasterDTO>(SqlCmd).FirstOrDefault();
            }
            return(ShiftMaster);
        }
Exemplo n.º 3
0
        public HttpResponseMessage GetShiftById(ShiftGetDTO objGetShiftById)
        {
            HttpResponseMessage message;

            try
            {
                // ShiftMasterDataAccessLayer dal = new ShiftMasterDataAccessLayer();
                var dynObj = new { result = _Shift.GetShiftById(objGetShiftById) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynObj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Somthing wrong, Try Again!" });
                ErrorLog.CreateErrorMessage(ex, "Shift", "GetShiftById");
            }
            return(message);
        }