private void save_data() { US_GD_TRANG_THAI_LAO_DONG v_us_gd_trang_thai_lao_dong = new US_GD_TRANG_THAI_LAO_DONG(); try { switch (m_e_form_mode) { case DataEntryFormMode.InsertDataState: //cho_trang_thai_lao_dong_cu_cua_nhan_vien_da_xoa_Y((decimal)m_sle_chon_nhan_vien.EditValue); form_2_us_obj(v_us_gd_trang_thai_lao_dong); v_us_gd_trang_thai_lao_dong.BeginTransaction(); v_us_gd_trang_thai_lao_dong.Insert(); v_us_gd_trang_thai_lao_dong.CommitTransaction(); m_id_gd_trang_thai_lao_dong_moi_tao = v_us_gd_trang_thai_lao_dong.dcID; CHRM_BaseMessages.MsgBox_Infor(CONST_ID_MSGBOX.INFOR_LUU_DU_LIEU_THANH_CONG); this.Close(); break; case DataEntryFormMode.UpdateDataState: v_us_gd_trang_thai_lao_dong.dcID = m_id_gd_trang_thai_lao_dong_4_update; form_2_us_obj(v_us_gd_trang_thai_lao_dong); v_us_gd_trang_thai_lao_dong.BeginTransaction(); v_us_gd_trang_thai_lao_dong.Update(); v_us_gd_trang_thai_lao_dong.CommitTransaction(); CHRM_BaseMessages.MsgBox_Infor(CONST_ID_MSGBOX.INFOR_DU_LIEU_DA_DUOC_CAP_NHAT); this.Close(); break; default: break; } } catch (Exception v_e) { v_us_gd_trang_thai_lao_dong.Rollback(); CSystemLog_301.ExceptionHandle(v_e); } }
private void cho_trang_thai_lao_dong_cu_cua_nhan_vien_da_xoa_Y(decimal ip_dc_id_nv) { try { decimal v_id_gd_trang_thai_lao_dong_hien_tai = 0; v_id_gd_trang_thai_lao_dong_hien_tai = find_id_gd_trang_thai_lao_dong_hien_tai(ip_dc_id_nv); if (v_id_gd_trang_thai_lao_dong_hien_tai == -1) { return; } else { US_GD_TRANG_THAI_LAO_DONG v_us = new US_GD_TRANG_THAI_LAO_DONG(v_id_gd_trang_thai_lao_dong_hien_tai); v_us.datNGAY_KET_THUC = m_dat_ngay_ap_dung.DateTime.AddDays(-1); v_us.strDA_XOA = "Y"; v_us.BeginTransaction(); v_us.Update(); v_us.CommitTransaction(); } } catch (Exception v_e) { CSystemLog_301.ExceptionHandle(v_e); } }