private void save_data() { US_GD_LOAI_LAO_DONG v_us_gd_loai_lao_dong = new US_GD_LOAI_LAO_DONG(); form_2_us_gd_loai_lao_dong(v_us_gd_loai_lao_dong); try { if (m_id_gd_loai_ld != 0) { MessageBox.Show("Nhân viên nãy đã tồn tại loại lao động! Nếu bạn muốn SỬA thông tin cho nhân viên vui lòng chọn nút SỬA!", "THÔNG BÁO!"); } else { v_us_gd_loai_lao_dong.BeginTransaction(); v_us_gd_loai_lao_dong.Insert(); v_us_gd_loai_lao_dong.CommitTransaction(); } } catch (Exception v_e) { CSystemLog_301.ExceptionHandle(v_e); } }
private void gan_du_lieu_cho_us_dm_nhan_vien(DataRow dataRow) { US_GD_LOAI_LAO_DONG v_us = new US_GD_LOAI_LAO_DONG(); v_us.dcID_NHAN_VIEN = find_id_nhan_vien_by_ma_nv(dataRow["MA_NV"].ToString().Trim()); if (dataRow["LOAI_LAO_DONG"].ToString() == "Trực tiếp") { v_us.dcID_LOAI_LAO_DONG = CONST_ID_LOAI_LAO_DONG.TRUC_TIEP; } else if (dataRow["LOAI_LAO_DONG"].ToString() == "Gián tiếp") { v_us.dcID_LOAI_LAO_DONG = CONST_ID_LOAI_LAO_DONG.GIAN_TIEP; } if (dataRow["NGAY_BAT_DAU"].ToString() != "") if ((dataRow["NGAY_BAT_DAU"].ToString().Substring(0, 10) != "")) v_us.datNGAY_BAT_DAU = CIPConvert.ToDatetime(dataRow["NGAY_BAT_DAU"].ToString().Substring(0, 10)); if (dataRow["NGAY_KET_THUC"].ToString() != "") if ((dataRow["NGAY_KET_THUC"].ToString().Substring(0, 10) != "")) v_us.datNGAY_KET_THUC = CIPConvert.ToDatetime(dataRow["NGAY_KET_THUC"].ToString().Substring(0, 10)); v_us.strDA_XOA = "N"; v_us.Insert(); }
private void luu_gd_loai_lao_dong() { try { US_GD_LOAI_LAO_DONG v_us = new US_GD_LOAI_LAO_DONG(); v_us.dcID_NHAN_VIEN = CIPConvert.ToDecimal(m_dc_id_nhan_vien.ToString()); v_us.dcID_LOAI_LAO_DONG = CIPConvert.ToDecimal(m_sle_loai_lao_dong.EditValue); if (m_dat_ngay_bat_dau.Checked == true) v_us.datNGAY_BAT_DAU = m_dat_ngay_bat_dau.Value; if (m_dat_ngay_ket_thuc.Checked == true) v_us.datNGAY_KET_THUC = m_dat_ngay_ket_thuc.Value; switch (m_e_form_mode) { case DataEntryFormMode.UpdateDataState: break; case DataEntryFormMode.InsertDataState: v_us.Insert(); break; default: break; } } catch (Exception) { MessageBox.Show("Lỗi loại lao động!"); } }