Ejemplo n.º 1
0
        private void Payment_Click(object sender, EventArgs e)
        {
            (new PaymentService()).ShowDialog();
            string Temp = (ClientsData.Current.Am).ToString() + "$";

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

            if (Temp != Amount.Text)
            {
                dataGridView1.Rows.Add("Transfer To Another The Account : ", PayMent.Value.ToString() + "$");
                ClientsLogs.AddLog("Transfer To Another The Account : ", PayMent.Value.ToString() + "$");
                Amount.Text = Temp;
                ClientsData.UpdateAccount();
            }
        }
Ejemplo n.º 3
0
 private void Main_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (MessageBox.Show("Are You Sure 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);
         }
     }
 }
Ejemplo 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();
            }
        }
Ejemplo 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(), Br.ReadString(), Br.ReadInt32());
                    CurPosition = Position;
                    ClientsLogs.SetAdress(Temp);
                    return(true);
                }
                Position += 100;
                FileStream.Seek(Position, SeekOrigin.Begin);
            }
            return(false);
        }
Ejemplo n.º 6
0
 public void TableIntial()
 {
     ClientsLogs.GetLogs(dataGridView1);
 }