private void editbranchAdminbtn_Click(object sender, EventArgs e)
        {
            if (editContact.Text == String.Empty || editEmail.Text == String.Empty || editPassword.Text == String.Empty)
            {
                MessageBox.Show("Fill all Fields", "Required", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                biller.Branch_ID = br_Id[editcombobranch.SelectedIndex];
                biller.Contact   = editContact.Text;
                biller.DOB       = editDOB.Value;
                biller.Email     = editEmail.Text;
                biller.Password  = editPassword.Text;

                ServiceBiller.Billerdata data = new ServiceBiller.Billerdata();
                data = s.updateBiller(biller);
                if (data != null)
                {
                    MessageBox.Show("Edit Successfully", "Edit", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    brBillderdata.Refresh();
                    All.BringToFront();
                }
                else
                {
                    MessageBox.Show("Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
 private void editprofilebtn_Click(object sender, EventArgs e)
 {
     ServiceBiller.Biller biller = new ServiceBiller.Biller();
     biller.Id        = UserInfo.id;
     biller.Branch_ID = UserInfo.branch_id;
     biller.Email     = billeremail.Text;
     biller.Contact   = contactcontact.Text;
     biller.DOB       = billlerdob.Value;
     if (billerpassword.Text == confirmpassword.Text)
     {
         biller.Password = billerpassword.Text;
         ServiceBiller.Billerdata data = new ServiceBiller.Billerdata();
         data = a.updateBiller(biller);
         if (data != null)
         {
             MessageBox.Show("Updated", "updated", MessageBoxButtons.OK, MessageBoxIcon.Information);
             confirmpassword.Text = "";
         }
         else
         {
             MessageBox.Show("Error", "Info !", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         MessageBox.Show("Confirm Password and Password not same", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        public Profile()
        {
            InitializeComponent();

            data = a.getSingle(UserInfo.id);
            if (data != null)
            {
                billeremail.Text    = data.Email;
                billerpassword.Text = data.Password;
                contactcontact.Text = data.Contact;
                billlerdob.Value    = data.DOB;
            }
        }
        private void brAdmindata_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            DialogResult r = CustomMessage.Show("Operation", "Select Edit or Delete", "Edit", "Delete", "Cancel");

            if (r == DialogResult.Yes)
            {
                DataGridViewRow row = brBillderdata.Rows[e.RowIndex];

                biller.Id        = Int32.Parse(row.Cells["Id"].Value.ToString());
                biller.Branch_ID = Int32.Parse(row.Cells["Branch_ID"].Value.ToString());
                biller.Contact   = row.Cells["Contact"].Value.ToString();
                biller.DOB       = (System.DateTime)row.Cells["DOB"].Value;
                biller.Email     = row.Cells["Email"].Value.ToString();
                biller.Password  = row.Cells["Password"].Value.ToString();

                editcombobranch.SelectedIndex = br_Id.IndexOf(biller.Branch_ID);
                editContact.Text  = biller.Contact;
                editDOB.Value     = biller.DOB;
                editEmail.Text    = biller.Email;
                editPassword.Text = biller.Password;
                Edit.BringToFront();
            }
            else if (r == DialogResult.No)
            {
                DataGridViewRow row = brBillderdata.Rows[e.RowIndex];



                ServiceBiller.Billerdata data = new ServiceBiller.Billerdata();
                data = s.deleteBiller(Int32.Parse(row.Cells["Id"].Value.ToString()));

                if (data != null)
                {
                    MessageBox.Show("Deleted successfully", "Deleted", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    brBillderdata.Refresh();
                }
            }
            else
            {
            }
        }