public async Task <IActionResult> Post([FromBody] Nominal value)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            await _nominalRepository.InsertAsync(value);

            return(Created($"nominal/{value.NominalId}", value));
        }
Beispiel #2
0
        /*/// <summary>
         * /// Initialize a new KV Level display
         * /// </summary>
         * /// <param name="xE"></param>
         * public MM_KVLevel(XmlElement xE)
         * {
         *  this.Name = xE.Attributes["Name"].Value;
         *
         *
         *  ReinitializeDisplay(xE);
         * }
         *
         * /// <summary>
         * /// Reinitialize the display elements
         * /// </summary>
         * /// <param name="xE"></param>
         * public void ReinitializeDisplay(XmlElement xE)
         * {
         *  this.Energized.ReinitializeDisplay(xE["Energized"]);
         *  this.PartiallyEnergized.ReinitializeDisplay(xE["PartiallyEnergized"]);
         *  this.DeEnergized.ReinitializeDisplay(xE["DeEnergized"]);
         *
         *  if (xE.HasAttribute("ShowPartiallyEnergized"))
         *      this.ShowPartiallyEnergized = XmlConvert.ToBoolean(xE.Attributes["ShowPartiallyEnergized"].Value);
         *  if (xE.HasAttribute("ShowEnergized"))
         *      this.ShowEnergized = XmlConvert.ToBoolean(xE.Attributes["ShowEnergized"].Value);
         *  if (xE.HasAttribute("Permitted"))
         *      this.Permitted = XmlConvert.ToBoolean(xE.Attributes["Permitted"].Value);
         *  if (xE.HasAttribute("ShowDeEnergized"))
         *      this.ShowDeEnergized = XmlConvert.ToBoolean(xE.Attributes["ShowDeEnergized"].Value);
         *  if (xE.HasAttribute("ShowMW"))
         *      this.ShowMVA= XmlConvert.ToBoolean(xE.Attributes["ShowMW"].Value);
         *  if (xE.HasAttribute("ShowMVA"))
         *      this.ShowMVA = XmlConvert.ToBoolean(xE.Attributes["ShowMVA"].Value);
         *  if (xE.HasAttribute("MVAThreshold"))
         *      this.MVAThreshold = MM_Converter.ToSingle(xE.Attributes["MVAThreshold"].Value);
         *  if (xE.HasAttribute("MWThreshold"))
         *      this.MVAThreshold = MM_Converter.ToSingle(xE.Attributes["MWThreshold"].Value);
         *  if (xE.HasAttribute("MVASize"))
         *      this.MVASize = MM_Converter.ToSingle(xE.Attributes["MVASize"].Value);
         *
         * }*/
        #endregion

        #region IComparable Members
        /// <summary>
        /// Handle the comparison between KV levels to allow for sorting
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public new int CompareTo(object obj)
        {
            int rt = Nominal.CompareTo(((MM_KVLevel)obj).Nominal);

            if (rt == 0 && obj.ToString() != ToString())
            {
                return(ToString().CompareTo(obj.ToString()));
            }

            return(rt);
        }
Beispiel #3
0
        /// <summary>
        /// Снятие налички.
        /// </summary>
        /// <param name="nominal">Типовой номинал.</param>
        /// <param name="bidsummma">Сумма, заданная вручную.</param>
        public void RemovalMoney(Nominal nominal, int bidsummma = 0)
        {
            int money = 0;

            spisanie  = 0;
            IsRemoval = false;

            if (bidsummma == 0)
            {
                money = (int)nominal;
                if (Result(money) & bidsummma == 0)
                {
                    switch (money)
                    {
                    case 100:
                        Summa -= 100;
                        break;

                    case 500:
                        Summa -= 500;
                        break;

                    case 1000:
                        Summa -= 1000;
                        break;

                    case 5000:
                        Summa -= 5000;
                        break;
                    }
                    IsRemoval = true;
                    spisanie  = money;
                }
                else
                {
                    MessageBox.Show($"Недостаточно средств для совершения операции.\nНе хватает {(money - Summa):C}.", "ATM", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            if (bidsummma > 0)
            {
                if (Result(bidsummma))
                {
                    Summa    -= bidsummma;
                    IsRemoval = true;
                    spisanie  = bidsummma;
                }
                else
                {
                    MessageBox.Show($"Недостаточно средств для совершения операции.\nНе хватает {(bidsummma - Summa):C}.", "ATM", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
        public async Task <IActionResult> Put([FromBody] Nominal value, [FromRoute] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != value.NominalId)
            {
                return(BadRequest());
            }

            await _nominalRepository.UpdateAsync(value);

            return(Ok(value));
        }
Beispiel #5
0
        /// <summary>
        /// Списать произвольную сумму.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SetAmount_Click(object sender, EventArgs e)
        {
            int     user_summa = 0;
            Nominal nominal    = new Nominal();

            nominal.ShowDialog();
            user_summa = nominal.Sum;

            MainForm owner = Owner as MainForm;

            if (IsDiscard(owner.ATM.TotalSum, user_summa))
            {
                owner.card.RemovalMoney(Card.Nominal.none, user_summa);
                owner.ATM.Transaction(owner.card.spisanie, owner.card.IsRemoval);
            }
        }
        public void WriteXml(XmlWriter writer)
        {
            writer.WriteAttributeString("nominal", Nominal.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("proMeanShift", ProMeanShift.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("hlmMeanShift", HlmMeanShift.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("cutOffValue", CutOffValve.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("additionalContribs",
                                        AdditionalContributors.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("sumPer", SumPercent.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("remPer", RemainingPercent.ToString(CultureInfo.InvariantCulture));

            foreach (Contributor contributor in Contributors)
            {
                writer.WriteStartElement("Contributor");
                contributor.WriteXml(writer);
                writer.WriteEndElement();
            }
        }
Beispiel #7
0
        public int CardValue(Nominal nominal)
        {
            switch (nominal)
            {
            case Nominal.Two:
            case Nominal.Jack:
                return(2);

            case Nominal.Three:
            case Nominal.Queen:
                return(3);

            case Nominal.Four:
            case Nominal.King:
                return(4);

            case Nominal.Five:
                return(5);

            case Nominal.Six:
                return(6);

            case Nominal.Seven:
                return(7);

            case Nominal.Eight:
                return(8);

            case Nominal.Nine:
                return(9);

            case Nominal.Ten:
                return(10);

            case Nominal.Ace:
                return(1);

            default:
                return(0);
            }
        }
        public void WriteXml(XmlWriter writer)
        {
            writer.WriteAttributeString("nominal", Nominal.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("mean", Mean.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("standardDeviation", StandardDeviation.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("lowerSpecLimit", LowerSpecLimit.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("upperSpecLimit", UpperSpecLimit.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("cp", Cp.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("cpk", Cpk.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("distribution", Distribution);
            writer.WriteAttributeString("skewness", Skewness.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("kurtosis", Kurtosis.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("sampleSize", SampleSize.ToString(CultureInfo.InvariantCulture));

            writer.WriteStartElement("Sample");
            Sample.WriteXml(writer);
            writer.WriteEndElement();

            writer.WriteStartElement("Estimate");
            Estimate.WriteXml(writer);
            writer.WriteEndElement();
        }
Beispiel #9
0
 public Card(Nominal n, Suit s)
 {
     numb = n;
     suit = s;
 }
Beispiel #10
0
 /// <summary>
 /// Converts to a string.
 /// </summary>
 public override string ToString()
 {
     return(String.Format(".{1}", Nominal.ToString("D2")));
 }
Beispiel #11
0
 /// <summary>
 /// Gets the hash code.
 /// </summary>
 public override int GetHashCode()
 {
     return(Nominal.GetHashCode());
 }
Beispiel #12
0
 public BuiltInFunctions()
 {
     // Text
     Functions["len"]         = new Len();
     Functions["lower"]       = new Lower();
     Functions["upper"]       = new Upper();
     Functions["left"]        = new Left();
     Functions["right"]       = new Right();
     Functions["mid"]         = new Mid();
     Functions["replace"]     = new Replace();
     Functions["rept"]        = new Rept();
     Functions["substitute"]  = new Substitute();
     Functions["concatenate"] = new Concatenate();
     Functions["concat"]      = new Concat();
     Functions["textjoin"]    = new Textjoin();
     Functions["char"]        = new CharFunction();
     Functions["exact"]       = new Exact();
     Functions["find"]        = new Find();
     Functions["fixed"]       = new Fixed();
     Functions["proper"]      = new Proper();
     Functions["search"]      = new Search();
     Functions["text"]        = new Text.Text();
     Functions["t"]           = new T();
     Functions["hyperlink"]   = new Hyperlink();
     Functions["value"]       = new Value(CultureInfo.CurrentCulture);
     Functions["trim"]        = new Trim();
     Functions["clean"]       = new Clean();
     Functions["unicode"]     = new Unicode();
     Functions["unichar"]     = new Unichar();
     Functions["numbervalue"] = new NumberValue();
     Functions["dollar"]      = new Dollar();
     // Numbers
     Functions["int"] = new CInt();
     // Math
     Functions["aggregate"]       = new Aggregate();
     Functions["abs"]             = new Abs();
     Functions["asin"]            = new Asin();
     Functions["asinh"]           = new Asinh();
     Functions["acot"]            = new Acot();
     Functions["acoth"]           = new Acoth();
     Functions["cos"]             = new Cos();
     Functions["cot"]             = new Cot();
     Functions["coth"]            = new Coth();
     Functions["cosh"]            = new Cosh();
     Functions["csc"]             = new Csc();
     Functions["csch"]            = new Csch();
     Functions["power"]           = new Power();
     Functions["gcd"]             = new Gcd();
     Functions["lcm"]             = new Lcm();
     Functions["sec"]             = new Sec();
     Functions["sech"]            = new SecH();
     Functions["sign"]            = new Sign();
     Functions["sqrt"]            = new Sqrt();
     Functions["sqrtpi"]          = new SqrtPi();
     Functions["pi"]              = new Pi();
     Functions["product"]         = new Product();
     Functions["ceiling"]         = new Ceiling();
     Functions["ceiling.precise"] = new CeilingPrecise();
     Functions["ceiling.math"]    = new CeilingMath();
     Functions["iso.ceiling"]     = new IsoCeiling();
     Functions["combin"]          = new Combin();
     Functions["combina"]         = new Combina();
     Functions["permut"]          = new Permut();
     Functions["permutationa"]    = new Permutationa();
     Functions["count"]           = new Count();
     Functions["counta"]          = new CountA();
     Functions["countblank"]      = new CountBlank();
     Functions["countif"]         = new CountIf();
     Functions["countifs"]        = new CountIfs();
     Functions["fact"]            = new Fact();
     Functions["factdouble"]      = new FactDouble();
     Functions["floor"]           = new Floor();
     Functions["floor.precise"]   = new FloorPrecise();
     Functions["floor.math"]      = new FloorMath();
     Functions["radians"]         = new Radians();
     Functions["roman"]           = new Roman();
     Functions["sin"]             = new Sin();
     Functions["sinh"]            = new Sinh();
     Functions["sum"]             = new Sum();
     Functions["sumif"]           = new SumIf();
     Functions["sumifs"]          = new SumIfs();
     Functions["sumproduct"]      = new SumProduct();
     Functions["sumsq"]           = new Sumsq();
     Functions["sumxmy2"]         = new Sumxmy2();
     Functions["sumx2my2"]        = new SumX2mY2();
     Functions["sumx2py2"]        = new SumX2pY2();
     Functions["seriessum"]       = new Seriessum();
     Functions["stdev"]           = new Stdev();
     Functions["stdeva"]          = new Stdeva();
     Functions["stdevp"]          = new StdevP();
     Functions["stdevpa"]         = new Stdevpa();
     Functions["stdev.s"]         = new StdevDotS();
     Functions["stdev.p"]         = new StdevDotP();
     Functions["subtotal"]        = new Subtotal();
     Functions["exp"]             = new Exp();
     Functions["log"]             = new Log();
     Functions["log10"]           = new Log10();
     Functions["ln"]              = new Ln();
     Functions["max"]             = new Max();
     Functions["maxa"]            = new Maxa();
     Functions["median"]          = new Median();
     Functions["min"]             = new Min();
     Functions["mina"]            = new Mina();
     Functions["mod"]             = new Mod();
     Functions["mode"]            = new Mode();
     Functions["mode.sngl"]       = new ModeSngl();
     Functions["mround"]          = new Mround();
     Functions["multinomial"]     = new Multinomial();
     Functions["average"]         = new Average();
     Functions["averagea"]        = new AverageA();
     Functions["averageif"]       = new AverageIf();
     Functions["averageifs"]      = new AverageIfs();
     Functions["round"]           = new Round();
     Functions["rounddown"]       = new Rounddown();
     Functions["roundup"]         = new Roundup();
     Functions["rand"]            = new Rand();
     Functions["randbetween"]     = new RandBetween();
     Functions["rank"]            = new Rank();
     Functions["rank.eq"]         = new RankEq();
     Functions["rank.avg"]        = new RankAvg();
     Functions["percentile"]      = new Percentile();
     Functions["percentile.inc"]  = new PercentileInc();
     Functions["percentile.exc"]  = new PercentileExc();
     Functions["quartile"]        = new Quartile();
     Functions["quartile.inc"]    = new QuartileInc();
     Functions["quartile.exc"]    = new QuartileExc();
     Functions["percentrank"]     = new Percentrank();
     Functions["percentrank.inc"] = new PercentrankInc();
     Functions["percentrank.exc"] = new PercentrankExc();
     Functions["quotient"]        = new Quotient();
     Functions["trunc"]           = new Trunc();
     Functions["tan"]             = new Tan();
     Functions["tanh"]            = new Tanh();
     Functions["atan"]            = new Atan();
     Functions["atan2"]           = new Atan2();
     Functions["atanh"]           = new Atanh();
     Functions["acos"]            = new Acos();
     Functions["acosh"]           = new Acosh();
     Functions["covar"]           = new Covar();
     Functions["covariance.p"]    = new CovarianceP();
     Functions["covariance.s"]    = new CovarianceS();
     Functions["var"]             = new Var();
     Functions["vara"]            = new Vara();
     Functions["var.s"]           = new VarDotS();
     Functions["varp"]            = new VarP();
     Functions["varpa"]           = new Varpa();
     Functions["var.p"]           = new VarDotP();
     Functions["large"]           = new Large();
     Functions["small"]           = new Small();
     Functions["degrees"]         = new Degrees();
     Functions["odd"]             = new Odd();
     Functions["even"]            = new Even();
     // Information
     Functions["isblank"]    = new IsBlank();
     Functions["isnumber"]   = new IsNumber();
     Functions["istext"]     = new IsText();
     Functions["isnontext"]  = new IsNonText();
     Functions["iserror"]    = new IsError();
     Functions["iserr"]      = new IsErr();
     Functions["error.type"] = new ErrorType();
     Functions["iseven"]     = new IsEven();
     Functions["isodd"]      = new IsOdd();
     Functions["islogical"]  = new IsLogical();
     Functions["isna"]       = new IsNa();
     Functions["na"]         = new Na();
     Functions["n"]          = new N();
     Functions["type"]       = new TypeFunction();
     // Logical
     Functions["if"]      = new If();
     Functions["ifs"]     = new Ifs();
     Functions["maxifs"]  = new MaxIfs();
     Functions["minifs"]  = new MinIfs();
     Functions["iferror"] = new IfError();
     Functions["ifna"]    = new IfNa();
     Functions["not"]     = new Not();
     Functions["and"]     = new And();
     Functions["or"]      = new Or();
     Functions["true"]    = new True();
     Functions["false"]   = new False();
     Functions["switch"]  = new Switch();
     Functions["xor"]     = new Xor();
     // Reference and lookup
     Functions["address"]  = new Address();
     Functions["hlookup"]  = new HLookup();
     Functions["vlookup"]  = new VLookup();
     Functions["lookup"]   = new Lookup();
     Functions["match"]    = new Match();
     Functions["row"]      = new Row();
     Functions["rows"]     = new Rows();
     Functions["column"]   = new Column();
     Functions["columns"]  = new Columns();
     Functions["choose"]   = new Choose();
     Functions["index"]    = new RefAndLookup.Index();
     Functions["indirect"] = new Indirect();
     Functions["offset"]   = new Offset();
     // Date
     Functions["date"]             = new Date();
     Functions["datedif"]          = new DateDif();
     Functions["today"]            = new Today();
     Functions["now"]              = new Now();
     Functions["day"]              = new Day();
     Functions["month"]            = new Month();
     Functions["year"]             = new Year();
     Functions["time"]             = new Time();
     Functions["hour"]             = new Hour();
     Functions["minute"]           = new Minute();
     Functions["second"]           = new Second();
     Functions["weeknum"]          = new Weeknum();
     Functions["weekday"]          = new Weekday();
     Functions["days"]             = new Days();
     Functions["days360"]          = new Days360();
     Functions["yearfrac"]         = new Yearfrac();
     Functions["edate"]            = new Edate();
     Functions["eomonth"]          = new Eomonth();
     Functions["isoweeknum"]       = new IsoWeekNum();
     Functions["workday"]          = new Workday();
     Functions["workday.intl"]     = new WorkdayIntl();
     Functions["networkdays"]      = new Networkdays();
     Functions["networkdays.intl"] = new NetworkdaysIntl();
     Functions["datevalue"]        = new DateValue();
     Functions["timevalue"]        = new TimeValue();
     // Database
     Functions["dget"]     = new Dget();
     Functions["dcount"]   = new Dcount();
     Functions["dcounta"]  = new DcountA();
     Functions["dmax"]     = new Dmax();
     Functions["dmin"]     = new Dmin();
     Functions["dsum"]     = new Dsum();
     Functions["daverage"] = new Daverage();
     Functions["dvar"]     = new Dvar();
     Functions["dvarp"]    = new Dvarp();
     //Finance
     Functions["cumipmt"]    = new Cumipmt();
     Functions["cumprinc"]   = new Cumprinc();
     Functions["dollarde"]   = new DollarDe();
     Functions["dollarfr"]   = new DollarFr();
     Functions["ddb"]        = new Ddb();
     Functions["effect"]     = new Effect();
     Functions["fvschedule"] = new FvSchedule();
     Functions["pduration"]  = new Pduration();
     Functions["rri"]        = new Rri();
     Functions["pmt"]        = new Pmt();
     Functions["ppmt"]       = new Ppmt();
     Functions["ipmt"]       = new Ipmt();
     Functions["ispmt"]      = new IsPmt();
     Functions["pv"]         = new Pv();
     Functions["fv"]         = new Fv();
     Functions["npv"]        = new Npv();
     Functions["rate"]       = new Rate();
     Functions["nper"]       = new Nper();
     Functions["nominal"]    = new Nominal();
     Functions["irr"]        = new Irr();
     Functions["mirr"]       = new Mirr();
     Functions["xirr"]       = new Xirr();
     Functions["sln"]        = new Sln();
     Functions["syd"]        = new Syd();
     Functions["xnpv"]       = new Xnpv();
     Functions["coupdays"]   = new Coupdays();
     Functions["coupdaysnc"] = new Coupdaysnc();
     Functions["coupdaybs"]  = new Coupdaybs();
     Functions["coupnum"]    = new Coupnum();
     Functions["coupncd"]    = new Coupncd();
     Functions["couppcd"]    = new Couppcd();
     Functions["price"]      = new Price();
     Functions["yield"]      = new Yield();
     Functions["yieldmat"]   = new Yieldmat();
     Functions["duration"]   = new Duration();
     Functions["disc"]       = new Disc();
     //Engineering
     Functions["bitand"]       = new BitAnd();
     Functions["bitor"]        = new BitOr();
     Functions["bitxor"]       = new BitXor();
     Functions["bitlshift"]    = new BitLshift();
     Functions["bitrshift"]    = new BitRshift();
     Functions["convert"]      = new ConvertFunction();
     Functions["bin2dec"]      = new Bin2Dec();
     Functions["bin2hex"]      = new Bin2Hex();
     Functions["bin2oct"]      = new Bin2Oct();
     Functions["dec2bin"]      = new Dec2Bin();
     Functions["dec2hex"]      = new Dec2Hex();
     Functions["dec2oct"]      = new Dec2Oct();
     Functions["hex2bin"]      = new Hex2Bin();
     Functions["hex2dec"]      = new Hex2Dec();
     Functions["hex2oct"]      = new Hex2Oct();
     Functions["oct2bin"]      = new Oct2Bin();
     Functions["oct2dec"]      = new Oct2Dec();
     Functions["oct2hex"]      = new Oct2Hex();
     Functions["delta"]        = new Delta();
     Functions["erf"]          = new Erf();
     Functions["erf.precise"]  = new ErfPrecise();
     Functions["erfc"]         = new Erfc();
     Functions["erfc.precise"] = new ErfcPrecise();
     Functions["besseli"]      = new BesselI();
     Functions["besselj"]      = new BesselJ();
     Functions["besselk"]      = new BesselK();
     Functions["bessely"]      = new BesselY();
 }
Beispiel #13
0
 public Card(Suit suit, Nominal nominal)
 {
     Suit    = suit;
     Nominal = nominal;
 }
Beispiel #14
0
 public PlayerCard(Suit suit, Nominal nominal, bool isValid) : base(suit, nominal)
 {
     IsValid = isValid;
 }
Beispiel #15
0
 public Card(Suit _suit, Nominal _nominal)
 {
     suit    = _suit;
     nominal = _nominal;
 }
Beispiel #16
0
 public NominalCashflowSet(Nominal Nominal, ListTermCashflowSet cashFlowSet)
 {
     this.Nominal     = Nominal;
     this.cashFlowSet = cashFlowSet;
 }