コード例 #1
0
        public string InsertSQL()
        {
            String sql = "insert into workorder (productorder,type,scheduledate,lenth,width," +
                         "thickness,gross,done,undone,completedate,machinecode,worker,worth,remark,status,receivedate,grosswidth) " +
                         "values ('{0}','{1}','{2}',{3},{4},{5},{6},{7},{8},'{9}','{10}','{11}',{12},'{13}',{14},'{15}',{16})";

            return(String.Format(sql, ProductOrder, Type, ScheduleDate.ToString("yyyy-MM-dd"), Length.ToString(), Width.ToString(),
                                 Thickness.ToString(), Gross.ToString(), Done.ToString(), Undo.ToString(), CompleteDate.ToString("yyyy-MM-dd"),
                                 MachineCode, Worker, Worth.ToString(), Remark, Status.ToString(), ReceiveDate.ToString("yyyy-MM-dd HH:mm:ss"), GrossWidth.ToString()));
        }
コード例 #2
0
        public string UndateSQL()
        {
            String sql = "update workorder set productorder = '{0}',type = '{1}',scheduledate='{2}',lenth={3},width = {4}," +
                         "thickness={5},gross={6},done={7},undone={8},completedate='{9}',machinecode='{10}',worker='{11}'," +
                         "worth={12},remark='{13}',status={14} ,receivedate = '{15}',grosswidth = {16} where id = {17} ";

            return(String.Format(sql, ProductOrder, Type, ScheduleDate.ToString("yyyy-MM-dd"), Length.ToString(), Width.ToString(),
                                 Thickness.ToString(), Gross.ToString(), Done.ToString(), Undo.ToString(), CompleteDate.ToString("yyyy-MM-dd"),
                                 MachineCode, Worker, Worth.ToString(), Remark, Status.ToString(), ReceiveDate.ToString("yyyy-MM-dd HH:mm:ss"),
                                 GrossWidth.ToString(), id.ToString()));
        }
コード例 #3
0
 private int CurrentWorthValue(Worth worth)
 {
     if (worth <= Worth.Nine)
     {
         return((int)worth + Variables.ValueCorrection);
     }
     if (worth == Worth.Ace)
     {
         return(Variables.AceValue);
     }
     return(Variables.FaceCardValue);
 }
コード例 #4
0
        public void GenerateReport(string filepath)
        {
            // Clear file
            if (File.Exists(filepath))
            {
                File.WriteAllText(filepath, string.Empty);
            }

            StreamWriter file = new StreamWriter(filepath);

            refresh();

            List <String> report = new List <string>();

            report.Add("Auto Generated report for: " + Username);
            report.Add(DateTime.Now.ToShortDateString());
            report.Add("------------------------------------------------");

            report.Add("");
            report.Add("Net Worth:\t" + Worth.ToString("C2"));
            report.Add("Cash on Hand:\t" + Cash.ToString("C2"));
            report.Add("Cash Borrowed:\t" + borrowedCash.ToString("C2"));
            report.Add("Num of Transactions: \t" + Transactions.Count.ToString());

            report.Add("");
            report.Add("Holdings");
            report.Add("--------");
            for (int i = 0; i < Holdings.Count; i++)
            {
                report.Add("\t" + (i + 1).ToString() + ". " + Holdings[i].companyName + " - " + Holdings[i].stockSymbol);
                report.Add("\t\tPerformance: " + Holdings[i].GetPerformance().ToString("P"));
                report.Add("\t\tNumber of Shares: " + Holdings[i].numOfShares);
                report.Add("\t\tWorth: " + Holdings[i].worth.ToString("C2"));
                report.Add("\t\tTotal Invested: " + Holdings[i].totalInvested.ToString("C2"));
            }

            for (int i = 0; i < report.Count; i++)
            {
                file.WriteLine(report[i]);
            }
            file.Close();
        }
コード例 #5
0
 public bool Equals(DummyTestClass other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(string.Equals(FirstName, other.FirstName) &&
            string.Equals(LastName, other.LastName) &&
            Age == other.Age && Height.Equals(other.Height) &&
            Worth.Equals(other.Worth) &&
            Weight == other.Weight &&
            DateOfBirth.TrimMilliseconds().Equals(other.DateOfBirth.TrimMilliseconds()) &&
            Initial == other.Initial &&
            Equals(Parents, other.Parents) &&
            IdNumber.Equals(other.IdNumber));
 }
コード例 #6
0
        private void FillDesk()
        {
            Worth worth = Worth.Two;
            Suite suite = Suite.Clubs;

            while (worth <= Worth.Ace)
            {
                _desk.Push(new Card {
                    Suite = suite, Worth = worth, Value = CurrentWorthValue(worth)
                });
                suite++;
                if (suite == Suite.Spades)
                {
                    _desk.Push(new Card {
                        Suite = suite, Worth = worth, Value = CurrentWorthValue(worth)
                    });
                    worth++;
                    suite = Suite.Clubs;
                }
            }
        }
コード例 #7
0
ファイル: BankCheck.cs プロジェクト: bsenyuva/ServUO
        public override void OnAdded(object parent)
#endif
        {
            base.OnAdded(parent);

            if (!AccountGold.Enabled)
            {
                return;
            }

            Mobile          owner     = null;
            SecureTradeInfo tradeInfo = null;

            Container root = parent as Container;

            while (root != null && root.Parent is Container)
            {
                root = (Container)root.Parent;
            }

            parent = root ?? parent;

            if (parent is SecureTradeContainer && AccountGold.ConvertOnTrade)
            {
                var trade = (SecureTradeContainer)parent;

                if (trade.Trade.From.Container == trade)
                {
                    tradeInfo = trade.Trade.From;
                    owner     = tradeInfo.Mobile;
                }
                else if (trade.Trade.To.Container == trade)
                {
                    tradeInfo = trade.Trade.To;
                    owner     = tradeInfo.Mobile;
                }
            }
            else if (parent is BankBox && AccountGold.ConvertOnBank)
            {
                owner = ((BankBox)parent).Owner;
            }

            if (owner == null || owner.Account == null || !owner.Account.DepositGold(Worth))
            {
                return;
            }

            if (tradeInfo != null)
            {
                if (owner.NetState != null && !owner.NetState.NewSecureTrading)
                {
                    var total = Worth / Math.Max(1.0, Account.CurrencyThreshold);
                    var plat  = (int)Math.Truncate(total);
                    var gold  = (int)((total - plat) * Account.CurrencyThreshold);

                    tradeInfo.Plat += plat;
                    tradeInfo.Gold += gold;
                }

                if (tradeInfo.VirtualCheck != null)
                {
                    tradeInfo.VirtualCheck.UpdateTrade(tradeInfo.Mobile);
                }
            }

            owner.SendLocalizedMessage(1042763, Worth.ToString("#,0"));

            Delete();

            ((Container)parent).UpdateTotals();
        }