Пример #1
0
        private void btnAddNew_Click(object sender, EventArgs e)
        {
            wdEmployeeUpdate frmEmpNew = new wdEmployeeUpdate(true);

            frmEmpNew.StartPosition = FormStartPosition.CenterScreen;
            frmEmpNew.ShowDialog();

            Employee_GetList();
        }
Пример #2
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            wdEmployeeUpdate frmEmpNew = new wdEmployeeUpdate(false);

            frmEmpNew.txtID.Text       = dgEmpList.CurrentRow.Cells["empid"].Value.ToString();
            frmEmpNew.txtEmpName.Text  = dgEmpList.CurrentRow.Cells["empname"].Value.ToString();
            frmEmpNew.txtIDCard.Text   = dgEmpList.CurrentRow.Cells["idcard"].Value.ToString();
            frmEmpNew.txtIDDate.Text   = dgEmpList.CurrentRow.Cells["idcarddate"].Value.ToString();
            frmEmpNew.txtTell.Text     = dgEmpList.CurrentRow.Cells["tell"].Value.ToString();
            frmEmpNew.txtAddr.Text     = dgEmpList.CurrentRow.Cells["address"].Value.ToString();
            frmEmpNew.cboPosition.Text = dgEmpList.CurrentRow.Cells["positionname"].Value.ToString();
            string strIDdate = dgEmpList.CurrentRow.Cells["idcarddate"].Value.ToString();

            frmEmpNew.txtIDDate.Value = DateTime.ParseExact(strIDdate, "M/d/yyyy hh:mm:ss tt", System.Globalization.CultureInfo.InvariantCulture);
            frmEmpNew.StartPosition   = FormStartPosition.CenterScreen;
            frmEmpNew.ShowDialog();
            Employee_GetList();
        }