private DataTable getMobileNumbers(int groupId)
        {
            BusinessLayer.SMS.DoctorMaster ObjDoc = new BusinessLayer.SMS.DoctorMaster();
            DataTable dtMobileNos = ObjDoc.GetDocNumbers(groupId);

            return(dtMobileNos);
        }
        protected void LoadDoctors()
        {
            BusinessLayer.SMS.DoctorMaster objDoc = new BusinessLayer.SMS.DoctorMaster();
            DataTable dtDoc = new DataTable();

            dtDoc = objDoc.GetAll();
            if (dtDoc != null)
            {
                dgvDoctors.DataSource = dtDoc;
                dgvDoctors.DataBind();
            }
        }
 protected void Populate()
 {
     BusinessLayer.SMS.DoctorMaster objdoc    = new BusinessLayer.SMS.DoctorMaster();
     Entity.SMS.DoctorMaster        docEntity = new Entity.SMS.DoctorMaster();
     docEntity = objdoc.GetById(DoctorId);
     if (docEntity != null)
     {
         ddlGroup.SelectedValue    = docEntity.GroupId.ToString();
         ddlDistrict.SelectedValue = docEntity.DistrictId.ToString();
         LoadBlock(Convert.ToInt32(ddlDistrict.SelectedValue));
         ddlBlock.SelectedValue = docEntity.BlockId.ToString();
         txtName.Text           = docEntity.FullName.ToString();
         txtMobileNo.Text       = docEntity.MobileNo.ToString();
     }
 }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            BusinessLayer.SMS.DoctorMaster objdoc    = new BusinessLayer.SMS.DoctorMaster();
            Entity.SMS.DoctorMaster        docEntity = new Entity.SMS.DoctorMaster();
            docEntity.DoctorId   = DoctorId;
            docEntity.GroupId    = Convert.ToInt32(ddlGroup.SelectedValue);
            docEntity.DistrictId = Convert.ToInt32(ddlDistrict.SelectedValue);
            docEntity.BlockId    = Convert.ToInt32(ddlBlock.SelectedValue);
            docEntity.FullName   = txtName.Text.ToString();
            docEntity.MobileNo   = txtMobileNo.Text.ToString();
            int RowAffected = objdoc.Save(docEntity);

            if (RowAffected > 0)
            {
                ltrMsg.Text = "DATA SAVED SUCCESSFULLY !!";
                ClearControls();
                LoadDoctors();
            }
            else
            {
                ltrMsg.Text = "DUPLICATE DATA !!";
            }
        }
 protected void dgvDoctors_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     BusinessLayer.SMS.DoctorMaster objDoc = new BusinessLayer.SMS.DoctorMaster();
     objDoc.Delete(Convert.ToInt32(dgvDoctors.DataKeys[e.RowIndex].Value));
     LoadDoctors();
 }