public virtual ContractChange Copy() { ContractChange change = new ContractChange(); change.ContractChangeCode = this.ContractChangeCode; change.OriginalContractChangeCode = this.OriginalContractChangeCode; change.ContractChangeId = this.ContractChangeId; change.ContractCode = this.ContractCode; change.Voucher = this.Voucher; change.Money = this.Money; change.ChangeMoney = this.ChangeMoney; change.NewMoney = this.NewMoney; change.OriginalMoney = this.OriginalMoney; change.TotalChangeMoney = this.TotalChangeMoney; change.SupplierChangeMoney = this.SupplierChangeMoney; change.ConsultantAuditMoney = this.ConsultantAuditMoney; change.ProjectAuditMoney = this.ProjectAuditMoney; change.ChangeReason = this.ChangeReason; change.Status = this.Status; change.ChangePerson = this.ChangePerson; change.ChangeDate = this.ChangeDate; change.ChangeType = this.ChangeType; change.CheckPerson = this.CheckPerson; change.CheckDate = this.CheckDate; change.AcceptChanges(); return(change); }
public static ContractChange CreateContractChange(string contractChangeContractChangeCode, string contractChangeContractChangeId, string contractChangeContractCode, string contractChangeVoucher, decimal?contractChangeMoney, decimal?contractChangeChangeMoney, decimal?contractChangeNewMoney, decimal?contractChangeOriginalMoney, decimal?contractChangeTotalChangeMoney, decimal?contractChangeSupplierChangeMoney, decimal?contractChangeConsultantAuditMoney, decimal?contractChangeProjectAuditMoney, string contractChangeChangeReason, int?contractChangeStatus, string contractChangeChangePerson, DateTime?contractChangeChangeDate, string contractChangeChangeType, string contractChangeCheckPerson, DateTime?contractChangeCheckDate) { ContractChange change = new ContractChange(); change.ContractChangeCode = contractChangeContractChangeCode; change.ContractChangeId = contractChangeContractChangeId; change.ContractCode = contractChangeContractCode; change.Voucher = contractChangeVoucher; change.Money = contractChangeMoney; change.ChangeMoney = contractChangeChangeMoney; change.NewMoney = contractChangeNewMoney; change.OriginalMoney = contractChangeOriginalMoney; change.TotalChangeMoney = contractChangeTotalChangeMoney; change.SupplierChangeMoney = contractChangeSupplierChangeMoney; change.ConsultantAuditMoney = contractChangeConsultantAuditMoney; change.ProjectAuditMoney = contractChangeProjectAuditMoney; change.ChangeReason = contractChangeChangeReason; change.Status = contractChangeStatus; change.ChangePerson = contractChangeChangePerson; change.ChangeDate = contractChangeChangeDate; change.ChangeType = contractChangeChangeType; change.CheckPerson = contractChangeCheckPerson; change.CheckDate = contractChangeCheckDate; return(change); }
public ContractCostChangeBase(string contractCostChangeContractCostChangeCode, string contractCostChangeContractCode, string contractCostChangeContractCostCode, string contractCostChangeContractChangeCode, decimal?contractCostChangeCash, decimal?contractCostChangeChangeCash, decimal?contractCostChangeNewCash, decimal?contractCostChangeOriginalCash, decimal?contractCostChangeTotalChangeCash, string contractCostChangeMoneyType, decimal?contractCostChangeExchangeRate, decimal?contractCostChangeMoney, decimal?contractCostChangeChangeMoney, decimal?contractCostChangeNewMoney, decimal?contractCostChangeOriginalMoney, decimal?contractCostChangeTotalChangeMoney, string contractCostChangeCostCode, string contractCostChangeCostBudgetSetCode, string contractCostChangeDescription, int?contractCostChangeStatus) { this.inTxn = false; this._contractChangeCodeSource = null; this._site = null; this.entityData = new ContractCostChangeEntityData(); this.backupData = null; this.ContractCostChangeCode = contractCostChangeContractCostChangeCode; this.ContractCode = contractCostChangeContractCode; this.ContractCostCode = contractCostChangeContractCostCode; this.ContractChangeCode = contractCostChangeContractChangeCode; this.Cash = contractCostChangeCash; this.ChangeCash = contractCostChangeChangeCash; this.NewCash = contractCostChangeNewCash; this.OriginalCash = contractCostChangeOriginalCash; this.TotalChangeCash = contractCostChangeTotalChangeCash; this.MoneyType = contractCostChangeMoneyType; this.ExchangeRate = contractCostChangeExchangeRate; this.Money = contractCostChangeMoney; this.ChangeMoney = contractCostChangeChangeMoney; this.NewMoney = contractCostChangeNewMoney; this.OriginalMoney = contractCostChangeOriginalMoney; this.TotalChangeMoney = contractCostChangeTotalChangeMoney; this.CostCode = contractCostChangeCostCode; this.CostBudgetSetCode = contractCostChangeCostBudgetSetCode; this.Description = contractCostChangeDescription; this.Status = contractCostChangeStatus; }
public ContractNexusBase() { this.inTxn = false; this._contractChangeCodeSource = null; this._site = null; this.entityData = new ContractNexusEntityData(); this.backupData = null; }
private string ToContractChangeString(ContractChange change, Product itemdetail) { MessageTemplateModel itemTemplate = _messageTemplateLogic.ReadForKey(MESSAGE_TEMPLATE_CONTRACTCHANGEITEMS); return(itemTemplate.Body.Inject(new { Status = (change.Status.Equals("Added")) ? "<font color=green>" + change.Status + "</font>" : "<font color=red>" + change.Status + "</font>", ProductNumber = change.ItemNumber, ProductDescription = (itemdetail != null) ? itemdetail.Name : "", Brand = (itemdetail != null) ? itemdetail.BrandExtendedDescription : "", Pack = (itemdetail != null) ? itemdetail.Pack : "", Size = (itemdetail != null) ? itemdetail.Size : "" })); }
public override bool Update(TransactionManager transactionManager, ContractChange entity) { SqlDatabase database = new SqlDatabase(this._connectionString); DbCommand command = StoredProcedureProvider.GetCommandWrapper(database, "dbo.ContractChange_Update", this._useStoredProcedure); database.AddInParameter(command, "@ContractChangeCode", DbType.AnsiString, entity.ContractChangeCode); database.AddInParameter(command, "@OriginalContractChangeCode", DbType.AnsiString, entity.OriginalContractChangeCode); database.AddInParameter(command, "@ContractChangeId", DbType.AnsiString, entity.ContractChangeId); database.AddInParameter(command, "@ContractCode", DbType.AnsiString, entity.ContractCode); database.AddInParameter(command, "@Voucher", DbType.AnsiString, entity.Voucher); database.AddInParameter(command, "@Money", DbType.Decimal, entity.Money.HasValue ? ((object)entity.Money) : ((object)DBNull.Value)); database.AddInParameter(command, "@ChangeMoney", DbType.Decimal, entity.ChangeMoney.HasValue ? ((object)entity.ChangeMoney) : ((object)DBNull.Value)); database.AddInParameter(command, "@NewMoney", DbType.Decimal, entity.NewMoney.HasValue ? ((object)entity.NewMoney) : ((object)DBNull.Value)); database.AddInParameter(command, "@OriginalMoney", DbType.Decimal, entity.OriginalMoney.HasValue ? ((object)entity.OriginalMoney) : ((object)DBNull.Value)); database.AddInParameter(command, "@TotalChangeMoney", DbType.Decimal, entity.TotalChangeMoney.HasValue ? ((object)entity.TotalChangeMoney) : ((object)DBNull.Value)); database.AddInParameter(command, "@SupplierChangeMoney", DbType.Decimal, entity.SupplierChangeMoney.HasValue ? ((object)entity.SupplierChangeMoney) : ((object)DBNull.Value)); database.AddInParameter(command, "@ConsultantAuditMoney", DbType.Decimal, entity.ConsultantAuditMoney.HasValue ? ((object)entity.ConsultantAuditMoney) : ((object)DBNull.Value)); database.AddInParameter(command, "@ProjectAuditMoney", DbType.Decimal, entity.ProjectAuditMoney.HasValue ? ((object)entity.ProjectAuditMoney) : ((object)DBNull.Value)); database.AddInParameter(command, "@ChangeReason", DbType.AnsiString, entity.ChangeReason); database.AddInParameter(command, "@Status", DbType.Int32, entity.Status.HasValue ? ((object)entity.Status) : ((object)DBNull.Value)); database.AddInParameter(command, "@ChangePerson", DbType.AnsiString, entity.ChangePerson); database.AddInParameter(command, "@ChangeDate", DbType.DateTime, entity.ChangeDate.HasValue ? ((object)entity.ChangeDate) : ((object)DBNull.Value)); database.AddInParameter(command, "@ChangeType", DbType.AnsiString, entity.ChangeType); database.AddInParameter(command, "@CheckPerson", DbType.AnsiString, entity.CheckPerson); database.AddInParameter(command, "@CheckDate", DbType.DateTime, entity.CheckDate.HasValue ? ((object)entity.CheckDate) : ((object)DBNull.Value)); int num = 0; if (transactionManager != null) { num = Utility.ExecuteNonQuery(transactionManager, command); } else { num = Utility.ExecuteNonQuery(database, command); } if (DataRepository.Provider.EnableEntityTracking) { EntityManager.StopTracking(entity.EntityTrackingKey); } entity.OriginalContractChangeCode = entity.ContractChangeCode; entity.AcceptChanges(); return(Convert.ToBoolean(num)); }
public ContractNexusBase(string contractNexusContractNexusCode, string contractNexusContractCode, string contractNexusContractChangeCode, string contractNexusCode, string contractNexusType, string contractNexusName, string contractNexusID, string contractNexusPerson, DateTime?contractNexusDate, string contractNexusPath, decimal?contractNexusMoney) { this.inTxn = false; this._contractChangeCodeSource = null; this._site = null; this.entityData = new ContractNexusEntityData(); this.backupData = null; this.ContractNexusCode = contractNexusContractNexusCode; this.ContractCode = contractNexusContractCode; this.ContractChangeCode = contractNexusContractChangeCode; this.Code = contractNexusCode; this.Type = contractNexusType; this.Name = contractNexusName; this.ID = contractNexusID; this.Person = contractNexusPerson; this.Date = contractNexusDate; this.Path = contractNexusPath; this.Money = contractNexusMoney; }
internal override void DeepLoad(TransactionManager transactionManager, ContractNexus entity, bool deep, DeepLoadType deepLoadType, Type[] childTypes, ChildEntityTypesList innerList) { if ((entity != null) && (base.CanDeepLoad(entity, "ContractChange", "ContractChangeCodeSource", deepLoadType, innerList) && (entity.ContractChangeCodeSource == null))) { object[] pkItems = new object[] { entity.ContractChangeCode ?? string.Empty }; ContractChange change = EntityManager.LocateEntity <ContractChange>(EntityLocator.ConstructKeyFromPkItems(typeof(ContractChange), pkItems), DataRepository.Provider.EnableEntityTracking); if (change != null) { entity.ContractChangeCodeSource = change; } else { entity.ContractChangeCodeSource = DataRepository.ContractChangeProvider.GetByContractChangeCode(entity.ContractChangeCode ?? string.Empty); } if (deep && (entity.ContractChangeCodeSource != null)) { DataRepository.ContractChangeProvider.DeepLoad(transactionManager, entity.ContractChangeCodeSource, deep, deepLoadType, childTypes, innerList); } } }
private Product TryToFindProductForContractChange(ContractChange change) { Product itemdetail = null; try { ProductsReturn tempProducts = null; List <string> tmp = new List <string>(); tmp.Add(change.ItemNumber); tempProducts = _catalogLogic.GetProductsByIds(change.CatalogId, tmp); if (tempProducts != null) { itemdetail = tempProducts.Products.Where(p => p.ItemNumber == change.ItemNumber).FirstOrDefault(); } } catch { _log.WriteWarningLog(string.Format("Failure to look up item {0}, branch {1}", change.ItemNumber, change.BranchId)); } return(itemdetail); }
private void AddContractChangeToNotification(ContractChange change, StringBuilder itemsContent) { itemsContent.Append(ToContractChangeString(change, TryToFindProductForContractChange(change))); }