protected override void OnSaving() { if (!(Session is NestedUnitOfWork) && (Session.DataLayer != null) && Session.IsNewObject(this) && (Session.ObjectLayer is SimpleObjectLayer)) { if (Numero == 0) { this.Progressivo = Session.FindObject <Impostazioni>(CriteriaOperator.Parse($"[Chiave]='{this.ClassInfo.TableName}_Progressivo'"), false)?.Valore; Numero = DistributedIdGeneratorHelper.Generate(Session.DataLayer, this.GetType().FullName, this.Progressivo); } if (String.IsNullOrEmpty(Codice)) { var f = Session.FindObject <Impostazioni>(CriteriaOperator.Parse($"[Chiave]='{this.ClassInfo.TableName}_Formato'"), false)?.Valore; if (f == null) { f = String.Concat(this.ClassInfo.TableName.Substring(0, 4).ToUpper(), "{Numero:00000}/{Progressivo}"); } Codice = ObjectFormatter.Format(f, this, EmptyEntriesMode.RemoveDelimiterWhenEntryIsEmpty); } } base.OnSaving(); }
protected override void OnSaving() { if (!(Session is NestedUnitOfWork) && (Session.DataLayer != null) && Session.IsNewObject(this) && (Session.ObjectLayer is SimpleObjectLayer)) { int sequence = 0; SeriesDocNumbers numbers = Session.FindObject <SeriesDocNumbers>(CriteriaOperator.Parse("CompanyID = ? and SeriesID = ?", CompanyID, SeriesID)); if (numbers == null) { numbers = new SeriesDocNumbers(Session); numbers.CompanyID = CompanyID; numbers.SeriesID = SeriesID; numbers.NextDocCode = "DLV"; numbers.NextDocSeq = 1; sequence = 1; } else { sequence = numbers.NextDocSeq + 1; numbers.NextDocSeq++; } DocNum = string.Format("{0} {1:D5}", numbers.NextDocCode, sequence); int deliveryCode = DistributedIdGeneratorHelper.Generate(Session.DataLayer, this.GetType().FullName, "deliveryServerPrefix"); Code = string.Format("{0}-{1}-{2}-{3:D4}", DocDate.Year, DocDate.Month, DocDate.Day, deliveryCode); } base.OnSaving(); }
protected override void OnSaved() { int nextSequence = DistributedIdGeneratorHelper.Generate(Session.DataLayer, this.GetType().FullName, "PurchaseOrder"); PurchaseOrderNumber = string.Format("{0:D6}", nextSequence); Save(); base.OnSaved(); }
private static int GenerateDistributedId(Session session, object obj) { if (!(session is NestedUnitOfWork) && session.IsNewObject(obj)) { int nextSequence = DistributedIdGeneratorHelper.Generate(session.DataLayer, obj.GetType().FullName, string.Empty); return(nextSequence); } return(-1); }
protected override void OnSaving() { if (!(Session is NestedUnitOfWork) && (Session.DataLayer != null) && (Session.IsNewObject(this)) && String.IsNullOrEmpty(Code)) { int value = DistributedIdGeneratorHelper.Generate(Session.DataLayer, this.GetType().FullName, "BankCollectionServerPrefix"); Code = String.Format("BÖ{0:D7}", value); } Definition = $"{Code} Nolu - {Date} Tarihli {BankID.Definition} Bankadan {AccountsID.Account} Nolu Hesaptan {AccountID.Definition} Hesabına {Amount} Tutarında Ödeme Yapılmıştır."; base.OnSaving(); }
protected override void OnSaving() { if (!(Session is NestedUnitOfWork && (Session.DataLayer != null) && Session.IsNewObject(this) && string.IsNullOrEmpty(Code))) { int value = DistributedIdGeneratorHelper.Generate(Session.DataLayer, this.GetType().FullName, "PurchaseInvoicePrefix"); Code = string.Format("AF{0:D8}", value); } Definition = $"{Code} Nolu - {Date} Tarihli {AccountID} Hesaba {OverallTotal} Tutarındaki Alış Faturası"; base.OnSaving(); }
protected override void OnSaving() { if (!(Session is NestedUnitOfWork) && (Session.DataLayer != null) && Session.IsNewObject(this) && string.IsNullOrEmpty(Kod)) { int deger = DistributedIdGeneratorHelper.Generate(Session.DataLayer, this.GetType().FullName, "SatisFaturasiPrefix"); Kod = string.Format("SF{0:D8}", deger); } base.OnSaving(); }
protected override void OnSaving() { if (!(Session is NestedUnitOfWork) && (Session.DataLayer != null) && Session.IsNewObject(this) && string.IsNullOrEmpty(Code)) { int sequence = DistributedIdGeneratorHelper.Generate(Session.DataLayer, this.GetType().FullName, "ItemServerPrefix"); Code = string.Format("{0:D8}", sequence); } base.OnSaving(); }
protected override void OnSaving() //Kaydetme İşlemi Yaparken Hazır Değer Döndürecek. { if (!(Session is NestedUnitOfWork) && (Session.DataLayer != null) && Session.IsNewObject(this) && //Yeni obje gelirse string.IsNullOrEmpty(Kod) //Boş Değer Geldiğinde ) { int deger = DistributedIdGeneratorHelper.Generate(Session.DataLayer, this.GetType().FullName, "BankaOdemeServerPrefix"); Kod = string.Format("BO{0:D7}", deger); //0000001 } base.OnSaving(); }
protected override void OnSaving() { if (!(Session is NestedUnitOfWork) && (Session.DataLayer != null) && Session.IsNewObject(this) && (Session.ObjectLayer is SimpleObjectLayer) //OR //&& !(Session.ObjectLayer is DevExpress.ExpressApp.Security.ClientServer.SecuredSessionObjectLayer) && string.IsNullOrEmpty(Code)) { int nextSequence = DistributedIdGeneratorHelper.Generate(Session.DataLayer, this.GetType().FullName, "MyServerPrefix"); Code = string.Format("N{0:D6}", nextSequence); } base.OnSaving(); }
public override void AfterConstruction() { base.AfterConstruction(); // Place your initialization code here (http://documentation.devexpress.com/#Xaf/CustomDocument2834). //this.PurchaseOrderNumber = GetNextPONumber(); this.PODate = DateTime.Today; // TimeSpan duration = new TimeSpan(72, 0, 0, 0); switch (DateTime.Today.DayOfWeek) { case DayOfWeek.Sunday: this.ExpectedReceiveDate = DateTime.Today.AddDays(3); break; case DayOfWeek.Thursday: this.ExpectedReceiveDate = DateTime.Today.AddDays(5); break; case DayOfWeek.Friday: this.ExpectedReceiveDate = DateTime.Today.AddDays(4); break; case DayOfWeek.Saturday: this.ExpectedReceiveDate = DateTime.Today.AddDays(4); break; default: this.ExpectedReceiveDate = DateTime.Today.AddDays(2); break; } this.PoStatus = PoStatus.Open; this.IsPrinted = true; if (!(Session is NestedUnitOfWork) && (Session.DataLayer != null) && Session.IsNewObject(this) && (Session.ObjectLayer is SimpleObjectLayer) //OR //&& !(Session.ObjectLayer is DevExpress.ExpressApp.Security.ClientServer.SecuredSessionObjectLayer) && string.IsNullOrEmpty(PurchaseOrderNumber)) { int nextSequence = DistributedIdGeneratorHelper.Generate(Session.DataLayer, this.GetType().FullName, "PurchaseOrder"); PurchaseOrderNumber = string.Format("{0:D6}", nextSequence); } }
public override void AfterConstruction() { base.AfterConstruction(); // Place your initialization code here (https://documentation.devexpress.com/eXpressAppFramework/CustomDocument112834.aspx). SalesOrderDate = DateTime.Now; SOStatus = SalesOrderStatus.New; if (!(Session is NestedUnitOfWork) && (Session.DataLayer != null) && Session.IsNewObject(this) && (Session.ObjectLayer is SimpleObjectLayer) //OR //&& !(Session.ObjectLayer is DevExpress.ExpressApp.Security.ClientServer.SecuredSessionObjectLayer) && string.IsNullOrEmpty(SalesOrderNumber)) { CustomerShippingAccount = CustomerNumber?.CustomerShippingAccount; ShippingType = CustomerNumber?.ShippingType; int nextSequence = DistributedIdGeneratorHelper.Generate(Session.DataLayer, this.GetType().FullName, "SalesOrder"); accountingSONumber = string.Format("SO{0:D6}", nextSequence); salesOrderNumber = accountingSONumber; } }
public override void AfterConstruction() { base.AfterConstruction(); int nextSequence = DistributedIdGeneratorHelper.Generate(Session.DataLayer, this.GetType().FullName, "LotID"); LotId = string.Format("{0:D6}", nextSequence); CreatedDate = DateTime.Now; DateInDoor = DateTime.Now; InTakeDt = DateTime.Now; RepackLotStatus = RepackStatusCodes.Intake; SendFile = true; LastDeliveryNumber = 0; ExpectedCompletionDt = CreatedDate.AddDays(4); // LotDescription = RepackItem.ItemDescription; LotExpirationDt = DateTime.Now.AddMonths(6); // RepackLotStatus = ; // Place your initialization code here (https://documentation.devexpress.com/eXpressAppFramework/CustomDocument112834.aspx). }
public override void AfterConstruction() { base.AfterConstruction(); key = "StringKey-" + DistributedIdGeneratorHelper.Generate(this.Session.DataLayer, this.GetType().FullName, string.Empty); }
public override void AfterConstruction() { base.AfterConstruction(); NumeroDoLote = "LO" + DistributedIdGeneratorHelper.Generate(this.Session.DataLayer, this.GetType().FullName, string.Empty).ToString().PadLeft(5, '0'); }