BKI_DichVuMatDat.US.US_GD_HOP_DONG.LayHopDongCuoiCungNhanVien C# (CSharp) Method

LayHopDongCuoiCungNhanVien() public method

public LayHopDongCuoiCungNhanVien ( decimal ip_dc_id_nhan_vien ) : DataRow
ip_dc_id_nhan_vien decimal
return System.Data.DataRow
        public DataRow LayHopDongCuoiCungNhanVien(decimal ip_dc_id_nhan_vien)
        {
            DataSet v_ds = new DataSet();
            v_ds.Tables.Add();
            CStoredProc v_cstore = new CStoredProc("pr_HD_hop_dong_nhan_vien_cuoi_cung_Get");
            v_cstore.addDecimalInputParam("@ip_dc_id_nhan_vien", ip_dc_id_nhan_vien);
            v_cstore.fillDataSetByCommand(this, v_ds);
            if (v_ds.Tables[0].Rows.Count == 0)
            {
                return null;
            }
            return v_ds.Tables[0].Rows[0];
        }

Usage Example

        void m_sle_chon_nhan_vien_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                if(m_e_form_mode != DataEntryFormMode.InsertDataState)
                {
                    return;
                }
                if(m_sle_chon_nhan_vien.EditValue == null)
                {
                    return;
                }
                US_GD_HOP_DONG v_us_hd = new US_GD_HOP_DONG();
                DataRow v_dr_hd_cuoi = v_us_hd.LayHopDongCuoiCungNhanVien(Convert.ToDecimal(m_sle_chon_nhan_vien.EditValue));
                if(v_dr_hd_cuoi != null)
                {
                    var v_dlg_confirm = XtraMessageBox.Show("Nhân viên đã có hợp đồng rồi. Bạn có muốn sử dụng dữ liệu của hợp đồng gần đây nhất để thêm mới hợp đồng cho nhân viên này?", "XÁC NHẬN", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if(v_dlg_confirm == System.Windows.Forms.DialogResult.Yes)
                    {
                        dr_hop_dong_cuoi_to_form(v_dr_hd_cuoi);
                        if(m_sle_mo_ta_cv.IsPopupOpen)
                        {
                            m_sle_mo_ta_cv.ClosePopup();
                        }

                        m_sle_chon_nhan_vien.Focus();
                    }
                }
            }
            catch(Exception v_e)
            {
                CSystemLog_301.ExceptionHandle(v_e);
            }
        }