Esempio n. 1
0
        private void Payment_Click(object sender, EventArgs e)
        {
            (new PaymentService()).ShowDialog();
            string Temp = (ClientsData.Current.Bal).ToString() + "SFX";

            if (Temp != Amount.Text)
            {
                dataGridView1.Rows.Add("Payment For " + PayMent.Pay + " : ", PayMent.Value.ToString() + "SFX");
                ClientsLogs.AddLog("Payment For " + PayMent.Pay + " : ", PayMent.Value.ToString() + "SFX");
                Amount.Text = Temp;
                ClientsData.UpdateAccount();
            }
        }
Esempio n. 2
0
        private void Transfer_Click(object sender, EventArgs e)
        {
            (new PayMent("Transfer")).ShowDialog();
            string Temp = (ClientsData.Current.Bal).ToString() + "SFX";

            if (Temp != Amount.Text)
            {
                dataGridView1.Rows.Add("Transfer To Another The Account : ", PayMent.Value.ToString() + "SFX");
                ClientsLogs.AddLog("Transfer To Another The Account : ", PayMent.Value.ToString() + "SFX");
                Amount.Text = Temp;
                ClientsData.UpdateAccount();
            }
        }
Esempio n. 3
0
 private void Main_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (MessageBox.Show("Are You Sure You Want To Exit?!", "Exit",
                         MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
     {
         e.Cancel = true;
     }
     else
     {
         if (!ClientsData.CloseStreams() || !ClientsLogs.CloseStreams())
         {
             MessageBox.Show("Data File Can't Be Closed Correctly!", "Error",
                             MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
Esempio n. 4
0
        public Main()
        {
            InitializeComponent();
            string Replay = ClientsData.OpenStreams();

            if (Replay != "Opened")
            {
                MessageBox.Show(Replay, "Can't Open Data File",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Dispose();
            }
            Replay = ClientsLogs.OpenStreams();
            if (Replay != "Opened")
            {
                MessageBox.Show(Replay, "Can't Open Data File",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Dispose();
            }
        }
Esempio n. 5
0
        public static bool LogInChecker(string Email, string Pass)
        {
            int Position = 100 * HashFunction(Email);

            FileStream.Seek(Position, SeekOrigin.Begin);
            while (Br.PeekChar() == 'T')
            {
                int Temp = Position;
                Br.ReadChar();
                if (Br.ReadString().ToLower() == Email && Br.ReadString() == Pass)
                {
                    Cur = new Client(Email, Pass, Br.ReadString(), Br.ReadString(), Br.ReadString(),
                                     Br.ReadString(), Br.ReadString());
                    CurPosition = Position;
                    ClientsLogs.SetAdress(Temp);
                    return(true);
                }
                Position += 100;
                FileStream.Seek(Position, SeekOrigin.Begin);
            }
            return(false);
        }
Esempio n. 6
0
 public void TableIntial()
 {
     ClientsLogs.GetLogs(dataGridView1);
 }