示例#1
0
 public CResult<List<Contract>> GetContractList(int peopleID)
 {
     if (peopleID <= 0) {
         return new CResult<List<Contract>>(new List<Contract>(), ErrorCode.ParameterError);
     }
     var result = new ContractDAL().GetContractList(peopleID);
     return new CResult<List<Contract>>(result);
 }
示例#2
0
 public CResult<bool> UpdateContract(Contract contract)
 {
     if (contract.ContractID <= 0) {
         return new CResult<bool>(false, ErrorCode.ParameterError);
     }
     var result = new ContractDAL().UpdateContract(contract);
     if (result) {
         return new CResult<bool>(true);
     } else {
         return new CResult<bool>(false, ErrorCode.SaveDataFailed);
     }
 }
示例#3
0
        public CResult<bool> InsertContract(Contract contract)
        {
            if (contract.PeopleID <= 0) {
                return new CResult<bool>(false, ErrorCode.ParameterError);
            }

            var result = new ContractDAL().InsertContract(contract);
            if (result) {
                return new CResult<bool>(true);
            } else {
                return new CResult<bool>(false, ErrorCode.DataNotExist);
            }
        }
示例#4
0
        public CResult<Contract> GetContractByID(int contractID)
        {
            if (contractID <= 0) {
                return new CResult<Contract>(null, ErrorCode.ParameterError);
            }

            var Contract = new ContractDAL().GetContractByID(contractID);
            if (Contract == null) {
                return new CResult<Contract>(null, ErrorCode.DataNotExist);
            } else {
                return new CResult<Contract>(Contract);
            }
        }
示例#5
0
        public CResult<bool> DeleteContractByID(int contractID)
        {
            if (contractID <= 0) {
                return new CResult<bool>(false, ErrorCode.ParameterError);
            }

            var dal = new ContractDAL();
            if (dal.GetContractByID(contractID) == null) {
                return new CResult<bool>(false, ErrorCode.DataNotExist);
            }

            var result = dal.DeleteContractByID(contractID);
            if (result) {
                return new CResult<bool>(true);
            } else {
                return new CResult<bool>(false, ErrorCode.DataNotExist);
            }
        }