Exemplo n.º 1
0
        private void Login_field_Click(object sender, EventArgs e)
        {
//            tick.Show();
//          tick1.Show();
            //get the values from UI
            u.UserEmail    = utextbox.Text;
            u.UserRole     = comboBox1.Text;
            u.UserName     = utextbox.Text;
            u.UserPassword = uptextbox.Text;
            //adding the value from UI to Database
            //create a boolean variable to check if the data is inserted successfully
            bool issuccess = dal.Valid(u);

            //check if the data is inserted successfully
            if (issuccess == true)
            {
                if (comboBox1.Text == "User")
                {
                    //data or user added successfully
                    this.Hide();
                    SignUpPOPUP f1 = new SignUpPOPUP(utextbox.Text);
                    f1.Show();
                }
                else if (comboBox1.Text == "Admin")
                {
                    //data or user added successfully
                    this.Hide();
                    Admin f1 = new Admin(utextbox.Text);
                    f1.Show();
                }
            }
        }
 public static void DoFullScreen(SignUpPOPUP bloodbank)
 {
     if (isfull == false)   //app not fullscreen, then fullscreen it
     {
         oldloc  = new Point(bloodbank.Location.X, bloodbank.Location.Y);
         oldSize = new Size(bloodbank.Size.Width, bloodbank.Size.Height);
         FullScreen(bloodbank);
         ismax  = false;
         isfull = true;
     }
     else //app is currently fullscreen so make it normal
     {
         if (oldSize.Width >= SystemInformation.WorkingArea.Width || oldSize.Height >= SystemInformation.WorkingArea.Height)
         {
             bloodbank.Location = defaultloc;
             bloodbank.Size     = defaultSize;
         }
         else
         {
             bloodbank.Location = oldloc;
             bloodbank.Size     = oldSize;
         }
         FullScreen(bloodbank);
         ismax  = false;
         isfull = false;
     }
 }
        public static void DoMaximize(SignUpPOPUP bloodbank)
        {
            if (ismax == false)   //app not maximize, then maximized it
            {
                oldloc  = new Point(bloodbank.Location.X, bloodbank.Location.Y);
                oldSize = new Size(bloodbank.Size.Width, bloodbank.Size.Height);
                Maximized(bloodbank);
                ismax  = true;
                isfull = false;
            }
            else //app is currently maximized so make it normal
            {
                if (oldSize.Width >= SystemInformation.WorkingArea.Width || oldSize.Height >= SystemInformation.WorkingArea.Height)
                {
                    bloodbank.Location = defaultloc;
                    bloodbank.Size     = defaultSize;
                }
                else
                {
                    bloodbank.Location = oldloc;
                    bloodbank.Size     = oldSize;
                }

                ismax  = false;
                isfull = false;
            }
        }
 public static void SetInitial(SignUpPOPUP BloodBankSystem)  //this method should fire when starts
 {
     oldloc      = BloodBankSystem.Location;
     oldSize     = BloodBankSystem.Size;
     defaultloc  = BloodBankSystem.Location;
     defaultSize = BloodBankSystem.Size;
 }
        public static void Maximized(SignUpPOPUP bloodbank)
        {
            int x = SystemInformation.WorkingArea.Width;
            int y = SystemInformation.WorkingArea.Height;

            bloodbank.WindowState = FormWindowState.Normal;
            bloodbank.Location    = new Point(0, 0);
            bloodbank.Size        = new Size(x, y);
        }
 static void FullScreen(SignUpPOPUP bloodbank)
 {
     if (bloodbank.WindowState == FormWindowState.Maximized)
     {
         bloodbank.WindowState = FormWindowState.Normal;
     }
     else if (bloodbank.WindowState == FormWindowState.Normal)
     {
         bloodbank.WindowState = FormWindowState.Maximized;
     }
 }
 public static void Minimized(SignUpPOPUP bloodbank)
 {
     if (bloodbank.WindowState == FormWindowState.Minimized)
     {
         bloodbank.WindowState = FormWindowState.Normal;
     }
     else if (bloodbank.WindowState == FormWindowState.Normal)
     {
         bloodbank.WindowState = FormWindowState.Minimized;
     }
 }
Exemplo n.º 8
0
        private void Cmdsignup_Click(object sender, EventArgs e)
        {
            //get the values from UI
            u.UserName         = fnamefield.Text;
            u.UserEmail        = efield.Text;
            u.UserConatct      = mblfield.Text;
            u.UserAddress      = addfield.Text;
            u.UserPassword     = pfield.Text;
            u.UserCfrmPassword = cpfield.Text;
            u.UserRole         = comboBox1.Text;
            u.Gender           = Gender;
            u.AddDate          = DateTime.Now;
            u.ImageSource      = imgSouece;

            //adding the value from UI to Database
            //create a boolean variable to check if the data is inserted successfully
            bool success = dal.Insert(u);


            //check if the data is inserted successfully
            if (success == true)
            {
                //data or user added successfully
                this.Hide();
                SignUpPOPUP f1 = new SignUpPOPUP(fnamefield.Text);
                f1.Show();
            }
            else
            {
                //failed to add user
                MessageBox.Show("Failed to Sign UP Try Again!");
            }


            //clear text boxes
            Clear();
        }