Exemplo n.º 1
0
        public void getMembers(int id)
        {
            this.member_id = id;
            OrderedDictionary dic = Managment.getInstance().getgymsnamesAndid(id, panel1, line_member, Txt_search);

            Managment.getInstance().readAllmembers((int)dic[0], Dgv_allmembers);
        }
Exemplo n.º 2
0
        private void Btn_extendMember_Click(object sender, EventArgs e)
        {
            int x = ((comboB_period.SelectedIndex + 1) * 30);

            Managment.getInstance().extendmember(member_id, gym_id, Convert.ToInt64(txt_price.Text.ToString()), x);
            Managment.getInstance().refreshmembersgrid(gym_id);
        }
Exemplo n.º 3
0
 public static Managment getInstance()
 {
     if (instance == null)
     {
         instance = new Managment();
     }
     return(instance);
 }
Exemplo n.º 4
0
        private void main_Load(object sender, EventArgs e)
        {
            line.Width = lbltab1.Width;
            line.Left  = lbltab1.Left;
            managerModel m = Managment.getInstance().getManagerName(id);

            lblname.Text   = m.Name;
            lblfamily.Text = m.Family;
        }
Exemplo n.º 5
0
        private void ExtendMember_Load(object sender, EventArgs e)
        {
            MemberModel m = Managment.getInstance().extendData(member_id, gym_id);

            Lbl_Name_2.Text             = m.Name;
            Lbl_Family_2.Text           = m.Family;
            Lbl_meliCode_2.Text         = m.Melicode;
            Lbl_GymName_2.Text          = m.Gym_name;
            comboB_period.SelectedIndex = 0;
        }
Exemplo n.º 6
0
        private void Btn_addmember_Click(object sender, EventArgs e)
        {
            if (Txt_name.Text.Length < 2)
            {
                MessageBox.Show("Name must be at least 3 charachters");
            }
            else if (Txt_family.Text.Length < 3)
            {
                MessageBox.Show("Family must be at least 3 charachters");
            }
            else if (txt_mellicode.Text.Length < 10 || txt_mellicode.Text.Length > 10)
            {
                MessageBox.Show("melicode must be 10 charachters");
            }

            else if (Txt_Address.Text.Length < 10)
            {
                MessageBox.Show("Address must be at least 10 charachters");
            }
            else if (Txt_telephone.Text.Length > 11 || Txt_telephone.Text.Length < 7)
            {
                MessageBox.Show("telephone must be between 7 and 11 charachters");
            }

            else if (Txt_mobile.Text.Length != 11)
            {
                MessageBox.Show("mobile must be 11 charachters");
            }
            else
            {
                MemberModel model = new MemberModel();
                DateTime    now   = DateTime.Now;

                model.Name              = Txt_name.Text.ToString();
                model.Family            = Txt_family.Text.ToString();
                model.Gender            = OSSwitch_Gender.Value ? 1 : 0;
                model.DOB               = Datepicker_DOB.Value;
                model.Melicode          = txt_mellicode.Text.ToString();
                model.Address           = Txt_Address.Text.ToString();
                model.Phone             = Txt_telephone.Text.ToString();
                model.Registration_date = now;
                model.Mobile            = Txt_mobile.Text.ToString();
                model.Expire_date       = DateTime.Now.AddDays(((Cmb_period.SelectedIndex + 1) * 30));
                model.Gymid             = Convert.ToInt32(Cmb_gyms.SelectedValue);
                // Txt_price.Text;

                Managment.getInstance().addmember(model, Convert.ToInt64(Txt_price.Text.ToString()));
                MessageBox.Show("successfully added");
                Managment.getInstance().refreshmembersgrid(Convert.ToInt32(Cmb_gyms.SelectedValue));
                Close();
            }
        }
Exemplo n.º 7
0
        private void Img_deletemember_Click(object sender, EventArgs e)
        {
            try
            {
                DataGridViewRow selectedRow = Dgv_allmembers.Rows[index];
                Managment.getInstance().deletMember((int)selectedRow.Cells[10].Value, (int)selectedRow.Cells[11].Value);
                Managment.getInstance().refreshmembersgrid((int)selectedRow.Cells[11].Value);
                //   ExtendMember extendMember = new ExtendMember((int)selectedRow.Cells[10].Value, (int)selectedRow.Cells[11].Value);


                // extendMember.ShowDialog();
            }
            catch (Exception s)
            {
            }
        }
Exemplo n.º 8
0
        private void Btn_editmember_Click(object sender, EventArgs e)
        {
            if (Txt_name.Text.Length < 2)
            {
                MessageBox.Show("Name must be at least 3 charachters");
            }
            else if (Txt_family.Text.Length < 3)
            {
                MessageBox.Show("Family must be at least 3 charachters");
            }


            else if (Txt_Address.Text.Length < 10)
            {
                MessageBox.Show("Address must be at least 10 charachters");
            }
            else if (Txt_telephone.Text.Length > 11 || Txt_telephone.Text.Length < 7)
            {
                MessageBox.Show("telephone must be between 7 and 11 charachters");
            }

            else if (Txt_mobile.Text.Length != 11)
            {
                MessageBox.Show("mobile must be 11 charachters");
            }
            else
            {
                MemberModel model = new MemberModel();
                DateTime    now   = DateTime.Now;

                model.Name              = Txt_name.Text.ToString();
                model.Family            = Txt_family.Text.ToString();
                model.Gender            = OSSwitch_Gender.Value ? 1 : 0;
                model.Address           = Txt_Address.Text.ToString();
                model.Phone             = Txt_telephone.Text.ToString();
                model.Registration_date = now;
                model.Mobile            = Txt_mobile.Text.ToString();
                Managment.getInstance().EditMember(member_id, Txt_name.Text.ToString(), Txt_family.Text.ToString(), OSSwitch_Gender.Value ? 1 : 0, Txt_Address.Text.ToString(), Txt_telephone.Text.ToString(), Txt_mobile.Text.ToString());



                MessageBox.Show("successfully eddited");
                Managment.getInstance().refreshmembersgrid(gym_id);
                Close();
                //Managment.getInstance().refreshmembersgrid(Convert.ToInt32(Cmb_gyms.SelectedValue));
            }
        }
Exemplo n.º 9
0
        private void EditMember_Load(object sender, EventArgs e)
        {
            MemberModel member = Managment.getInstance().geteditData(member_id);

            Txt_name.Text      = member.Name;
            Txt_family.Text    = member.Family;
            Txt_mobile.Text    = member.Mobile;
            Txt_telephone.Text = member.Phone;
            if (member.Gender == 1)
            {
                OSSwitch_Gender.Value = true;
            }
            else
            {
                OSSwitch_Gender.Value = false;
            }
            Txt_Address.Text    = member.Address;
            Label_melicode.Text = member.Melicode;
        }
Exemplo n.º 10
0
 public void getfinancials(int manager_id)
 {
     Managment.getInstance().getFinancials(manager_id, 1, Dgv_register_income);
     Managment.getInstance().getFinancials(manager_id, 2, Dgv_extend_income);
 }
Exemplo n.º 11
0
 private void addmember_Load(object sender, EventArgs e)
 {
     Managment.getInstance().getgymsnames(Cmb_gyms, manager_id);
     Cmb_period.SelectedIndex = 0;
 }
Exemplo n.º 12
0
 private void txtSearch_TextChanged(object sender, EventArgs e)
 {
     Managment.getInstance().DView.RowFilter = "member_meli_code like '" + Txt_search.text.ToString() + "%'";
 }