protected void modalBtnSubmit_Command(object sender, CommandEventArgs e)
 {
     int userid = Convert.ToInt32(modalDropDownUsers.SelectedItem.Value);
     for (int i = 0; i < gridViewModal.Rows.Count; i++)
     {
         SupervisorMapping supmap = new SupervisorMapping();
         CheckBox cb = (CheckBox)gridViewModal.Rows[i].FindControl("modalChkSupervisor");
         Label labelSupId = (Label)gridViewModal.Rows[i].FindControl("modalLabelSupId");
         int supid = Convert.ToInt32(labelSupId.Text);
         supmap = supmap.GetSupervisorMapping(userid, supid);
         if (cb.Checked)
         {
             if (supmap == null)
             {
                 supmap = new SupervisorMapping();
                 supmap.UserId = userid;
                 supmap.SupervisorId = supid;
                 supmap.Insert(supmap);
             }
         }
         else
         {
             if (supmap != null)
             {
                 supmap.Delete(supmap.Id);
             }
         }
     }
     Session["SupMap"] = null;
     this.programmaticModalPopup.Hide();
     InitializeMainGrid();
 }