Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            AdminSession AS = new AdminSession();

            AS.Show();
            this.Hide();
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            AdminSession admin = new AdminSession(this);

            admin.Show(this);
            this.Hide();
        }
Пример #3
0
 public RegistrationForm(AdminSession a)
 {
     InitializeComponent();
     this.ActiveControl = tb_Name;
     tb_Name.Focus();
     tb_Password.PasswordChar = '*';
     backOpt = true;
 }
Пример #4
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (backOpt == true)
     {
         this.Hide();
         AdminSession ads = new AdminSession(new Manager());
         ads.Show();
     }
     else
     {
         this.Hide();
         Login log = new Login();
         log.Show();
     }
 }
Пример #5
0
 private void button3_Click(object sender, EventArgs e)
 {
     if (back == true)
     {
         this.Hide();
         SeeBazarHistory sbh = new SeeBazarHistory(new Manager());
         sbh.Show();
     }
     else if (backNot == true)
     {
         this.Hide();
         Notification nf = new Notification();
         nf.Show();
     }
     else
     {
         this.Hide();
         AdminSession AS = new AdminSession();
         AS.Show();
     }
 }
Пример #6
0
 private void button3_Click(object sender, EventArgs e)
 {
     if (backToAdmin == true)
     {
         this.Hide();
         AdminSession AS = new AdminSession();
         AS.Show();
     }
     else if (backToSeaBM == true)
     {
         this.Hide();
         SeeBookedMeal sbm = new SeeBookedMeal(new Manager());
         sbm.Show();
     }
     else
     {
         this.Hide();
         Notification nf = new Notification();
         nf.Show();
     }
 }
Пример #7
0
 public EditMealChart(AdminSession adminBack)
     : this()
 {
     this.managerBack = adminBack;
 }
Пример #8
0
 public Calculation(AdminSession adminBack) : this()
 {
     this.managerBack = adminBack;
 }
Пример #9
0
 public AdminChange(AdminSession adminBack) : this()
 {
     this.managerBack = adminBack;
 }
Пример #10
0
 public EditBzaar(AdminSession adminSession)
 {
     InitializeComponent();
 }
Пример #11
0
 public EditMealChart(AdminSession adminSession)
 {
     InitializeComponent();
     backToAdmin = true;
 }
Пример #12
0
 public EditBazar(AdminSession manager) : this()
 {
     this.managerBack = manager;
 }
Пример #13
0
        private void btn_Confirm_Click(object sender, EventArgs e)
        {
            if (tb_Name.Text != "" && tb_Password.Text != "" && tb_Phone.Text != "" && tb_userName.Text != "" && cb_bloodGroup.Text != "" && cb_ManagerName.Text != "" && cb_MessName.Text != "" && tb_imagePath.Text != "")
            {
                byte[] img = null;
                try
                {
                    FileStream   fs = new FileStream(tb_imagePath.Text, FileMode.Open, FileAccess.Read);
                    BinaryReader br = new BinaryReader(fs);
                    img = br.ReadBytes((int)fs.Length);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                if (tb_Name.Text.Trim() == "")
                {
                    confirmFlag = false;
                }
                //else if (rb_Manager.Checked == false && rb_Member.Checked == false) { confirmFlag = false; }
                //else if (rb_Member.Checked == false) { confirmFlag = false; }
                else if (cb_ManagerName.Text.Trim() == "")
                {
                    confirmFlag = false;
                }
                else if (cb_MessName.Text.Trim() == "")
                {
                    confirmFlag = false;
                }
                else if (cb_ManagerName.Text.Trim() == "")
                {
                    confirmFlag = false;
                }
                else if (cb_bloodGroup.Text.Trim() == "")
                {
                    confirmFlag = false;
                }
                else if (tb_userName.Text.Trim() == "")
                {
                    confirmFlag = false;
                }
                else if (tb_Password.Text.Trim() == "")
                {
                    confirmFlag = false;
                }
                else if (tb_Phone.Text.Trim() == "")
                {
                    confirmFlag = false;
                }


                info.name = tb_Name.Text;

                if (rb_Member.Checked == true)
                {
                    _userType = "Member";
                }
                if (rb_Manager.Checked == true)
                {
                    _userType = "Manager";
                }
                info.userType       = _userType;
                info.refManagrtName = cb_ManagerName.Text;
                info.messName       = cb_MessName.Text;
                info.dob            = Convert.ToDateTime(date_dob.Value.ToShortDateString());
                info.bloodGroup     = cb_bloodGroup.Text;
                info.userName       = tb_userName.Text;
                info.password       = tb_Password.Text;
                info.phone          = Convert.ToInt32(tb_Phone.Text);
                info.pic            = img;
                if (confirmFlag == true)
                {
                    int rowAffected = opr.insertUser(info);
                    if (rowAffected > 0)
                    {
                        MessageBox.Show("Data Saved SuccessFull.");
                        if (backOpt == true)
                        {
                            this.Hide();
                            AdminSession ads = new AdminSession(new Manager());
                            ads.Show();
                        }
                        else
                        {
                            this.Hide();
                            Login log = new Login();
                            log.Show();
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("Please Fill Every Field Properly");
            }
        }