コード例 #1
0
        /// <summary>
        /// 新增收费
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="ContractPayee"></param>
        /// <returns></returns>
        public int Add(int ID, ContractPayeeInfo ContractPayee)
        {
            var entity = new ContractPayeeEntity(ContractPayee);

            entity.IsDelete = false;

            if (entity.ContractObjectID == 0)
            {
                var conObj = _PMContext.ContractObjectEntity.SingleOrDefault(
                    o => o.ObjectKey == ContractPayee.ObjectKey &&
                    o.ObjectID == ContractPayee.ObjectID &&
                    o.ContractID == ID);

                entity.ContractObjectID = conObj.ID;
            }

            if (string.IsNullOrEmpty(entity.Note))
            {
                entity.Note = "";
            }

            this._DB.Add(entity);

            if (ContractPayee.AttachIDs != null)
            {
                foreach (var attachID in ContractPayee.AttachIDs)
                {
                    AddAttach(entity.ID, attachID);
                }
            }


            return(entity.ID);
        }
コード例 #2
0
 public ContractPayeeEntity(ContractPayeeInfo Info)
 {
     this.ID = Info.ID;
     this.ContractObjectID = Info.ContractObjectID;
     this.Fee         = Info.Fee;
     this.Date        = Info.Date;
     this.Note        = Info.Note;
     this.InvoiceType = Info.InvoiceType;
     this.IsDelete    = Info.IsDelete;
     this.Type        = Info.Type;
 }
コード例 #3
0
ファイル: ContractController.cs プロジェクト: sethHome/House
 public int AddPayee(int ID, ContractPayeeInfo Info)
 {
     return(_IContractPayeeService.Add(ID, Info));
 }