コード例 #1
0
        public List <ContractMasterDTO> GetAllContractMasters(ContractMasterGetDTO objGetContract)
        {
            List <ContractMasterDTO> contract = new List <ContractMasterDTO>();

            using (DbLayer dbLayer = new DbLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spSelectContract");
                SqlCmd.CommandType = CommandType.StoredProcedure;
                SqlCmd.Parameters.AddWithValue("@ActionBy", objGetContract.ActionBy);
                contract = dbLayer.GetEntityList <ContractMasterDTO>(SqlCmd);
            }
            return(contract);
        }
コード例 #2
0
        public List <ContractMasterDTO> GetInActiveContractMaster(ContractMasterGetDTO objInActive)
        {
            List <ContractMasterDTO> InActiveList = new List <ContractMasterDTO>();

            using (DbLayer dbLayer = new DbLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spSelectContract");
                SqlCmd.CommandType = CommandType.StoredProcedure;
                SqlCmd.Parameters.AddWithValue("@Active", 0);
                SqlCmd.Parameters.AddWithValue("@ActionBy", objInActive.ActionBy);
                InActiveList = dbLayer.GetEntityList <ContractMasterDTO>(SqlCmd);
            }
            return(InActiveList);
        }
コード例 #3
0
        public ContractMasterDTO GetContractMasterById(ContractMasterGetDTO objGetContractById)
        {
            ContractMasterDTO contract = new ContractMasterDTO();

            using (DbLayer dbLayer = new DbLayer())
            {
                SqlCommand SqlCmd = new SqlCommand("spSelectContract");
                SqlCmd.CommandType = CommandType.StoredProcedure;
                SqlCmd.Parameters.AddWithValue("@Id", objGetContractById.Id);
                SqlCmd.Parameters.AddWithValue("@ActionBy", objGetContractById.ActionBy);
                contract = dbLayer.GetEntityList <ContractMasterDTO>(SqlCmd).FirstOrDefault();
            }
            return(contract);
        }
コード例 #4
0
        public HttpResponseMessage GetActiveContractMaster(ContractMasterGetDTO objContract)
        {
            HttpResponseMessage message;

            try
            {
                //  ContractMasterDataAccessLayer dal = new ContractMasterDataAccessLayer();
                var dynObj = new { result = _obj.GetActiveContractMaster(objContract) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynObj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Somthing wrong, Try Again!" });
                ErrorLog.CreateErrorMessage(ex, "ContactMaster", "GetActiveContractMaster");
            }
            return(message);
        }