/** **************************************************************************************** * Notify activation/deactivation * @param phase Information if activated or deactivated. ******************************************************************************************/ public virtual void NotifyActivation( enums.Phase phase ) { if ( phase == enums.Phase.Begin ) ALIB.StdOutputStreamsLock.AddAcquirer ( null ); else ALIB.StdOutputStreamsLock.RemoveAcquirer( null ); }
public bool AddValidationMessage(enums.enumMessageType MessageType, string Message) { if (ValidationMessages == null) { ValidationMessages = new List<CrossValidationMessage>(); } ValidationMessages.Add(new CrossValidationMessage { MessageType = MessageType, Message = Message }); return true; }
public frmInfo( enums.infoType type1, int ind1 ) { type = type1; ind = ind1; platformSpec.resolution.set( this.Controls ); switch ( type ) { case enums.infoType.units: this.Text = Statistics.units[ ind ].name; break; case enums.infoType.terrain: this.Text = Statistics.terrains[ ind ].name; break; case enums.infoType.techno: this.Text = Statistics.technologies[ ind ].name; break; case enums.infoType.gov: this.Text = Statistics.governements[ ind ].name; break; case enums.infoType.eco : this.Text = Statistics.economies[ ind ].name; break; case enums.infoType.resources: this.Text = Statistics.resources[ ind ].name; break; case enums.infoType.tutorial: this.Text = Tutorial.getTextFromInd( ind ).title; break; case enums.infoType.buildings: this.Text = Statistics.buildings[ ind ].name; break; case enums.infoType.smallWonders: this.Text = Statistics.smallWonders[ ind ].name; break; case enums.infoType.wonders: this.Text = Statistics.wonders[ ind ].name; break; } }
public listIndividualsForm(Quatre quatre, Form parentForm, bool selectOnly, enums.ListFilter filter) { this.quatre = quatre; this.parentform = parentForm; this.selectonly = selectOnly; this.filter = filter; InitializeComponent(); if (!this.selectonly) { buttonSelect.Text = "Edit"; } }
public IPhoneFactory GetProducts(enums productName) { switch (productName) { case enums.SAMSUNG: return(new SamsungFactory()); case enums.HTC: return(new HTCFactory()); case enums.NOKIA: return(new NokiaFactory()); } throw new Exception("invalid input"); }
void SwitchState(enums.PlayerActionStates newState) { switch (playerState) { case enums.PlayerActionStates.Idle: IdleExit(); break; case enums.PlayerActionStates.Walk: WalkExit(); break; } playerState = newState; switch (playerState) { case enums.PlayerActionStates.Idle: IdleEnter(); break; case enums.PlayerActionStates.Walk: WalkEnter(); break; } }
public List<int> cancelPayment(enums.paymentAction _paymentAction) { //First check this payment is able to be cancelled ************ //get Related transacions and input reveres ones using (var ctx = new AccContexts()) { //get Payment details var payment = ctx.payment .Where(x => x.ID == paymentID).SingleOrDefault(); if (payment == null) throw new Exception("Payment Could not be found"); this.paymentID=(int)payment.ID; this.payerEntityID=(int)payment.payerEntityID; this.payeeEntityID=(int)payment.payeeEntityID; this.amount=(decimal)payment.amount; this.currencyID=(int)payment.currencyID; //get payment Transactions var paymentTransactions = ctx.paymentAction .Where(x => x.paymentID == this.paymentID) .Single() .paymentActionTransaction .Select(x => new { ownerEntityID=x.transaction.account.ownerEntityID, catTypeID = x.transaction.account.catTypeID, amount = x.transaction.amount, currencyID = x.transaction.account.currencyID }) .ToList(); //enter and save revered Transactions List<int> reveresedTransactions = new List<int>(); foreach (var txn in paymentTransactions) reveresedTransactions.Add(Transaction.createNew((int)txn.ownerEntityID, (int)txn.catTypeID, -1 * (decimal)txn.amount, (int)txn.currencyID)); //IF PAYMENT ACTION IS REFUND, NEW FEE HANDLING TRANSACTIONS WOULD BE NEEDED return reveresedTransactions; } }
/* public Unit( byte type ) { this.type = type; } */ public Unit( byte type, string name, string description, byte attack, byte defense, byte move, enums.speciality speciality, byte terrain, byte transport, int cost, byte disponibility, byte obselete, byte sight, byte range, bool entrenchable, bool highSeaSync, bool stealth, byte neededResource ) { this.type = type; this.name = name; this.description = description; this.attack = attack; this.defense = defense; this.move = move; this.speciality = speciality; this.terrain = terrain; this.transport = transport; this.cost = cost; this.disponibility = disponibility; // tech this.obselete = obselete; // unit this.sight = sight; this.range = range; this.entrenchable = entrenchable; this.highSeaSync = highSeaSync; this.stealth = stealth; this.neededResource = neededResource; // this.neededTechno = Statistics.technologies[ disponibility ]; try { this.bmp = new Bitmap( Form1.appPath + "\\images\\units\\" + name + ".png"); } catch ( Exception e ) { throw ( new Exception( "Error loading: " + name + ".png\n\n" + e.Message ) ); } }
public Governement( enums.governements type, string name, string description, bool oppressive, bool surrenderOnConquer, bool canBeChooseByPlayer, byte prod, byte food, byte trade, byte counterIntPerc, byte sciencePerc, byte techno, Stat.Governement.supportType support ) { this.type = (byte)type; this.name = name; this.description = description; this.oppresive = oppressive; this.surrenderOnConquer = surrenderOnConquer; this.neededTechno = techno; this.thisSupport = support; this.canBeChoosedByPlayer = canBeChooseByPlayer; this.productionPerc = prod; this.foodPerc = food; this.tradePerc = trade; // this.popGrowthPerc = popGrowthPerc; this.sciencePerc = sciencePerc; this.counterIntPerc = counterIntPerc; }
private EAXEffects(string value) { switch (value.ToUpper()) { case "DEFAULTEAXON": this.value = enums.DefaultEAXON; break; case "COMBATSOUNDSEAX": this.value = enums.CombatSoundsEAX; break; case "KOTODRUMSEAX": this.value = enums.KotoDrumsEAX; break; case "SPELLSEAX": this.value = enums.SpellsEAX; break; case "MISSILESEAX": this.value = enums.MissilesEAX; break; case "HEROACKSEAX": this.value = enums.HeroAcksEAX; break; case "DOODADSEAX": this.value = enums.DoodadsEAX; break; default: this.value = enums.None; break; } }
public Terrain( enums.terrainType type ) { this.type = (byte)type; }
/// <summary> /// Just for entittyType {person,Organization} /// </summary> /// <param name="inv"></param> /// <param name="amount"></param> /// <param name="cardID"></param> /// <param name="cardType"></param> protected void payInvoiceByCC(classes.Invoice inv, decimal amount, int cardID, enums.ccCardType cardType) { inv.doCCExtPayment(amount, cardID, cardType); }
public void setFeeForCreditCardType(enums.ccCardType ccCardType, decimal amount, string description) { ccFee ccFee = new ccFee(); ccFee.createNew(this.bankID, amount, description, (int)ccCardType); }
private void RecordInvoiceTransaction(List<int> transactions, enums.invoiceStat invoiceStat) { using (var ctx = new AccContexts()) using (var ts = new TransactionScope()) { //create invoice Action var invAction = new AccountingLib.Models.invoiceAction() { invoiceID = this.invoiceID, invoiceStatID = (int)invoiceStat }; ctx.invoiceAction.AddObject(invAction); ctx.SaveChanges(); //create invoice Transactions and invoice action Transactions foreach (var item in transactions) { var invActionTrans = new AccountingLib.Models.invoiceActionTransaction() { invoiceActionID = invAction.ID, transactionID = item }; ctx.invoiceActionTransaction.AddObject(invActionTrans); ctx.SaveChanges(); } ts.Complete(); } }
private void RecordInvoicePaymentTransactions(List<int> txns, int paymentID , enums.paymentStat payStat) { using (var ctx = new AccountingLib.Models.AccContexts()) { //Create Payment Action var payAction = new AccountingLib.Models.paymentAction() { paymentID = paymentID, paymentStatID = (int)payStat }; ctx.paymentAction.AddObject(payAction); ctx.SaveChanges(); //Record Pyament Action TXNS foreach (var txn in txns) { var newPayActionTxn = new paymentActionTransaction() { paymentActionID = payAction.ID, transactionID = txn }; ctx.paymentActionTransaction.AddObject(newPayActionTxn); ctx.SaveChanges(); } } }
public void doCCExtPayment(decimal amount,int cardID,enums.ccCardType ccCardType) { //var ccFeeFor using (var ctx = new AccContexts()) using (var ts = new TransactionScope()) { classes.ccPayment creditCardPayment = new ccPayment(); creditCardPayment.createNew(this.receiverEntityID, this.issuerEntityID, amount, this.currencyID, cardID); /*Record New Invoice Payment*/ var NewInvoicePayment = new AccountingLib.Models.invoicePayment() { invoiceID = invoiceID, paymentID = creditCardPayment.paymentID }; ctx.invoicePayment.AddObject(NewInvoicePayment); ctx.SaveChanges(); //get Fee bank cardType var card = new classes.card.CreditCard(); card.loadByCardID(cardID); ccFee ccfee = new ccFee(); ccfee.loadccFeeByBankCardTypeID((int)ccCardType, (card as Entity).getBankByCard(card.cardID).bankID); //Record related transctions [for invoice payment] List <int> transactions = new List<int>(); transactions.Add(Transaction.createNew(receiverEntityID, (int)AssetCategories.CCCASH, -1 * amount, this.currencyID)); transactions.Add(Transaction.createNew(receiverEntityID, (int)LibCategories.AP, +1 * amount, this.currencyID)); transactions.Add(Transaction.createNew(issuerEntityID, (int)AssetCategories.W, +1 * amount - (decimal)ccfee.amount, this.currencyID)); transactions.Add(Transaction.createNew(issuerEntityID, (int)AssetCategories.AR, -1 * amount, this.currencyID)); transactions.Add(Transaction.createNew(issuerEntityID, (int)OECategories.EXP, (decimal)ccfee.amount, this.currencyID)); /*Record Invoice Payment transactions*/ this.RecordInvoicePaymentTransactions(transactions, creditCardPayment.paymentID, enums.paymentStat.PaidApproved); /*Record Invoice Transaction*/ enums.invoiceStat? invoicestat=null; switch(ccCardType) { case enums.ccCardType.MASTERCARD: invoicestat=enums.invoiceStat.masterCardPaymant; break; case enums.ccCardType.VISACARD: invoicestat=enums.invoiceStat.visaCardPaymant; break; } this.RecordInvoiceTransaction(transactions, (enums.invoiceStat)invoicestat); ts.Complete(); } }
public void payInvoiceByCC(classes.Invoice inv, decimal amount, int cardID, enums.ccCardType cardType) { base.payInvoiceByCC(inv, amount, cardID, cardType); }
public bool canSwithToGov( enums.governements ind ) { if ( ind == enums.governements.anarchy ) return false; else return ( technos[ Statistics.governements[ (byte)ind ].neededTechno ].researched ); }