private void ScatterData()
        {
            ServiceEmployee _service = new ServiceEmployee();

            try
            {
                TBL_MP_Master_Employee_LastEmployerDetail model = _service.GetLastEmployerInfoDBRecordByID(this.SelectID);
                if (model != null)
                {
                    txtName.Text        = model.LastEmployerName;
                    txtAddress.Text     = model.Address;
                    txtContactNo.Text   = model.ContactNo.ToString();
                    chkIsActive.Checked = model.isActive;
                }
                TBL_MP_Master_Employee emp = _service.GetEmployeeDbRecordByID(SelectedEmployeeID);
                this.Text = string.Format("{0} ({1}) - Update X-Employer's Info.", emp.EmployeeName, emp.EmployeeCode);
            }
            catch (Exception ex)
            {
                string errMessage = ex.Message;
                if (ex.InnerException != null)
                {
                    errMessage += string.Format("\n{0}", ex.InnerException.Message);
                }
                MessageBox.Show(errMessage, "frmAddEditLastEmployerInfo::ScatterData", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            TBL_MP_Master_Employee_LastEmployerDetail model = null;
            ServiceEmployee _service = new ServiceEmployee();

            try
            {
                if (!this.ValidateChildren())
                {
                    return;
                }

                if (this.SelectID == 0)
                {
                    model = new TBL_MP_Master_Employee_LastEmployerDetail();
                }
                else
                {
                    model = _service.GetLastEmployerInfoDBRecordByID(this.SelectID);
                }

                model.LastEmployerID   = SelectID;
                model.FK_EmployeeId    = this.SelectedEmployeeID;
                model.LastEmployerName = txtName.Text.Trim();
                model.Address          = txtAddress.Text.Trim();
                model.ContactNo        = int.Parse(txtContactNo.Text.Trim());
                model.isActive         = chkIsActive.Checked;

                if (this.SelectID == 0)
                {
                    this.SelectID = _service.AddNewLastEmployerInfo(model);
                }
                else
                {
                    _service.UpdateLastEmployerInfo(model);
                }


                this.DialogResult = DialogResult.OK;
            }
            catch (Exception ex)
            {
                string errMessage = ex.Message;
                if (ex.InnerException != null)
                {
                    errMessage += string.Format("\n{0}", ex.InnerException.Message);
                }
                MessageBox.Show(errMessage, "frmAddEditLastEmployerInfo::btnOK_Click", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }