public int Add(ContractInfo Contract) { var entity = new ContractEntity(Contract); entity.IsDelete = false; entity.CreateDate = DateTime.Now; if (string.IsNullOrEmpty(entity.Note)) { entity.Note = ""; } this._DB.Add(entity); //foreach (var attachID in Contract.AttachIDs) //{ // AddAttach(entity.ID, attachID); //} foreach (var engineering in Contract.Engineerings) { AddEngineering(entity.ID, engineering.ID); } return(entity.ID); }
public ContractInfo(ContractEntity Entity) { this.ID = Entity.ID; this.Number = Entity.Number; this.Name = Entity.Name; this.CustomerID = Entity.CustomerID; this.SignDate = Entity.SignDate; this.Fee = Entity.Fee; this.Type = Entity.Type; this.Status = Entity.Status; this.Note = Entity.Note; this.CreateDate = Entity.CreateDate; this.IsDelete = Entity.IsDelete; }
public void SetEntity(ContractEntity Entity) { if (!this.Number.Equals(Entity.Number)) { this.Number = Entity.Number; } if (!this.Name.Equals(Entity.Name)) { this.Name = Entity.Name; } if (!this.CustomerID.Equals(Entity.CustomerID)) { this.CustomerID = Entity.CustomerID; } if (!this.SignDate.Equals(Entity.SignDate)) { this.SignDate = Entity.SignDate; } if (!this.Fee.Equals(Entity.Fee)) { this.Fee = Entity.Fee; } if (!this.Type.Equals(Entity.Type)) { this.Type = Entity.Type; } if (!this.Status.Equals(Entity.Status)) { this.Status = Entity.Status; } if (!this.Note.Equals(Entity.Note)) { this.Note = Entity.Note; } if (!this.CreateDate.Equals(Entity.CreateDate)) { this.CreateDate = Entity.CreateDate; } if (!this.IsDelete.Equals(Entity.IsDelete)) { this.IsDelete = Entity.IsDelete; } }