Пример #1
0
        public FrmManageDona()
        {
            InitializeComponent();
            if (frm == null)
            {
                frm = this;
            }
            dataGridViewDonations.DataSource = Dona.GET_ALL_Donations();
            lblSumTotalDonations.Text        = Convert.ToString(Dona.Get_SumOFDonations());
            lblSumCurrentDonations.Text      = Convert.ToString(Dona.Get_SumOFDonations());
            DRC = Dona.Get_SumOFDonations().Rows;
            lblSumCurrentDonations.Text = DRC[0][0].ToString();
            lblSumTotalDonations.Text   = DRC[0][0].ToString();


            //for arabic Language
            //dataGridViewDonations.DataSource = Dona.GET_ALL_Donations_Ar();
        }
Пример #2
0
        private void login_Click(object sender, EventArgs e)
        {
            DataTable        dt  = log.Login(txtID.Text, txtPWD.Text);
            FrmAddDona       fAD = new FrmAddDona();
            FrmChangePass    fCP = new FrmChangePass();
            FrmCreateIDs     fCI = new FrmCreateIDs();
            FrmDistDonations fDD = new FrmDistDonations();
            FrmMemList       fML = new FrmMemList();
            FrmPayments      fP  = new FrmPayments();
            FrmReports       fR  = new FrmReports();

            PL.FrmBackup        fB   = new PL.FrmBackup();
            PL.FrmConfig        fC   = new PL.FrmConfig();
            PL.FrmDonaList      fDL  = new PL.FrmDonaList();
            PL.FrmManageDona    fMD  = new PL.FrmManageDona();
            PL.FrmManageMem     fMM  = new PL.FrmManageMem();
            PL.FrmPreview       fPre = new PL.FrmPreview();
            PL.FrmRestoreServer fRS  = new PL.FrmRestoreServer();
            PL.frmUserList      fUL  = new PL.frmUserList();


            if (dt.Rows.Count > 0)
            {
                MessageBox.Show("Login success");
                if (dt.Rows[0][3].ToString() == "User" || dt.Rows[0][3].ToString() == "user")
                {
                    Main x = new Main();
                    x.Show();
                    x.ID       = dt.Rows[0][0].ToString();
                    x.Username = dt.Rows[0][1].ToString();
                    x.Password = dt.Rows[0][2].ToString();
                    this.Hide();
                }
                else if (dt.Rows[0][3].ToString() == "Admin" || dt.Rows[0][3].ToString() == "admin")
                {
                    Main x = new Main();
                    x.Show();
                    x.ID       = dt.Rows[0][0].ToString();
                    x.Username = dt.Rows[0][1].ToString();
                    x.Password = dt.Rows[0][2].ToString();
                    this.Hide();
                }
                else if (dt.Rows[0][3].ToString() == "Employee" || dt.Rows[0][3].ToString() == "Employee")
                {
                    Main x = new Main();
                    x.Show();
                    x.ID       = dt.Rows[0][0].ToString();
                    x.Username = dt.Rows[0][1].ToString();
                    x.Password = dt.Rows[0][2].ToString();
                    this.Hide();
                }
                //Main.getMainForm.Show();
                //this.Close();



                /* try
                 * {
                 *  Main main = new Main();
                 *  main.ID = dt.Rows[0][0].ToString();
                 *  main.Username = dt.Rows[0][1].ToString();
                 *  main.Password = dt.Rows[0][2].ToString();
                 *  changePass.txtID.Text = dt.Rows[0][1].ToString();
                 *  Application.Run(new FrmChangePass());
                 *  //Application.Run(new Main());
                 * }
                 * catch(Exception ex){
                 *  MessageBox.Show(ex.Message);
                 * }*/
            }
            else
            {
                MessageBox.Show("login fail");
            }
        }
Пример #3
0
 static void frm_FormClosed(object sender, FormClosedEventArgs e)
 {
     frm = null;
 }