コード例 #1
0
        private void LogOut_Click(object sender, EventArgs e)
        {
            PersonInfo.Clear();



            LogInToolBarBox.Visible = true;
            LogOut.Visible          = false;
            AddDeposit.Visible      = false;
            AddMBox.Visible         = false;
            SumBox.Visible          = false;
            TermBox.Visible         = false;
            RepenishBox.Visible     = false;
            WithdrawSumBox.Visible  = false;
            ToolBarBox.Visible      = false;
            StopDepNumBox.Visible   = false;
            WithdrawBox.Visible     = false;

            BinaryFormatter formatter = new BinaryFormatter();

            using (FileStream fs = new FileStream("DB.dat", FileMode.OpenOrCreate))
            {
                formatter.Serialize(fs, clientData.Clients);
            }

            if (clientData.Clients.Count != 0)
            {
                PersonInfo.AppendText("Перелік існуючих номерів акаунтів: " + Environment.NewLine);
                for (int i = 0; i < clientData.Clients.Count; i++)
                {
                    PersonInfo.AppendText(Convert.ToString(clientData.Clients[i].AccountNum) + Environment.NewLine);
                }
            }
        }
コード例 #2
0
 private void RefrAccNums_Click(object sender, EventArgs e)
 {
     PersonInfo.Clear();
     if (clientData.Clients.Count != 0)
     {
         PersonInfo.AppendText("Перелік існуючих номерів акаунтів: " + Environment.NewLine);
         for (int i = 0; i < clientData.Clients.Count; i++)
         {
             PersonInfo.AppendText(Convert.ToString(clientData.Clients[i].AccountNum) + Environment.NewLine);
         }
     }
 }
コード例 #3
0
        private void ShowInfo()
        {
            PersonInfo.Clear();
            PersonInfo.AppendText("Шановний клієнте! Ви знаходитесь в приватному кабінеті." + Environment.NewLine + "Номер особового рахунку: " + CurrentClient.AccountNum + Environment.NewLine +
                                  "Паспортні дані:" + Environment.NewLine + "Прізвище: " + CurrentClient.PassportInfo.Surname + Environment.NewLine + "Ім'я: " + CurrentClient.PassportInfo.Name + Environment.NewLine + "По-батькові: " + CurrentClient.PassportInfo.FName + Environment.NewLine);


            if (CurrentClient.Holdings.Count != 0)
            {
                DateTime temp = CurrentClient.Holdings[0].LastOperationDate;

                PersonInfo.AppendText("Поточні вклади:" + Environment.NewLine);
                int count = 0;
                foreach (var deposit in CurrentClient.Holdings)
                {
                    if (deposit.DepositName == 1)
                    {
                        if (deposit.CalcNumMonthLeft(DateTime.Now) >= 1)
                        {
                            PersonInfo.AppendText("Термін депозиту: " + deposit.DepositTerm + " міс." + "," + " сума вкладу: " + deposit.StartAmount + " грн." + Environment.NewLine + "Дата вкладу: " + deposit.StartDate + Environment.NewLine);
                        }
                        else
                        {
                            CurrentClient.Holdings.Remove(CurrentClient.Holdings[count]);
                        }
                        count++;
                    }
                    else if (deposit.DepositName == 2)
                    {
                        PersonInfo.AppendText("Скарбничка. Сума вкладу: " + deposit.StartAmount + " грн." + Environment.NewLine + "Дата вкладу: " + deposit.StartDate + Environment.NewLine);
                    }

                    if (deposit.LastOperationDate > temp)
                    {
                        temp = deposit.LastOperationDate;
                    }
                }


                PersonInfo.AppendText("Дата останньої операції: " + temp + Environment.NewLine);
            }
        }