Exemplo n.º 1
0
        public List <StatusMasterDTO> GetAllStatus(StatusMasterGetDTO objGetStatus)
        {
            List <StatusMasterDTO> status = new List <StatusMasterDTO>();

            using (DbLayer dbLayer = new DbLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spSelectStatus");
                SqlCmd.Parameters.AddWithValue("@ActionBy", objGetStatus.ActionBy);
                SqlCmd.CommandType = CommandType.StoredProcedure;
                status             = dbLayer.GetEntityList <StatusMasterDTO>(SqlCmd);
            }
            return(status);
        }
Exemplo n.º 2
0
        public List <StatusMasterDTO> GetInActiveStatus(StatusMasterGetDTO objActive)
        {
            List <StatusMasterDTO> inactiveList = new List <StatusMasterDTO>();

            using (DbLayer dbLayer = new DbLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spSelectStatus");
                SqlCmd.CommandType = CommandType.StoredProcedure;
                SqlCmd.Parameters.AddWithValue("@Active", 0);
                SqlCmd.Parameters.AddWithValue("@ActionBy", objActive.ActionBy);
                inactiveList = dbLayer.GetEntityList <StatusMasterDTO>(SqlCmd);
            }
            return(inactiveList);
        }
Exemplo n.º 3
0
        public StatusMasterDTO GetStatusById(StatusMasterGetDTO objGetReqirementById)
        {
            StatusMasterDTO requirement = new StatusMasterDTO();

            using (DbLayer dbLayer = new DbLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spSelectStatus");
                SqlCmd.CommandType = CommandType.StoredProcedure;
                SqlCmd.Parameters.AddWithValue("@Id", objGetReqirementById.Id);
                SqlCmd.Parameters.AddWithValue("@ActionBy", objGetReqirementById.ActionBy);
                requirement = dbLayer.GetEntityList <StatusMasterDTO>(SqlCmd).FirstOrDefault();
            }
            return(requirement);
        }
Exemplo n.º 4
0
        public HttpResponseMessage GetActiveStatus(StatusMasterGetDTO objActive)
        {
            HttpResponseMessage message;

            try
            {
                // StatusMasterDataAccessLayer dal = new StatusMasterDataAccessLayer();
                var dynObj = new { result = _status.GetActiveStatus(objActive) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynObj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Somthing wrong, Try Again!" });
                ErrorLog.CreateErrorMessage(ex, "StatusMaster", "GetActiveStatus");
            }
            return(message);
        }