private void m_cmd_update_Click(object sender, EventArgs e) { try{ grid2us_object(m_us, m_fg.Row); f102_TuDien_DE v_f102_detail = new f102_TuDien_DE(); v_f102_detail.UpdateObj(m_us); load_data_2_grid(); load_data_2_grid_nguoi_dai_dien(m_us.dcID); } catch (Exception v_e){ CSystemLog_100.ExceptionHandle(v_e); }
private void updateGiaTriTuDien() { if (!this.isMaTuDienRow(m_fg.Row)) { return; } DataRow v_drTuDien = (DataRow) (m_fg.Rows[m_fg.Row].UserData); US_CM_DM_TU_DIEN v_usTuDien = new US_CM_DM_TU_DIEN(); v_usTuDien.DataRow2Me(v_drTuDien); try { f102_TuDien_DE v_CalledForm = new f102_TuDien_DE(); if (v_CalledForm.UpdateObj(v_usTuDien) == DialogResult.OK) { v_usTuDien.Me2DataRow(v_drTuDien); this.TuDienDataRow_2_GridRow(v_drTuDien, m_fg.Row); } } catch (System.Exception v_e) { CSystemLog_301.ExceptionHandle(v_e); } }
private void m_cmd_insert_Click(object sender, EventArgs e) { try{ m_us.dcID_LOAI_TU_DIEN = LOAI_TU_DIEN_ID.PHONG_BAN_NOI_BO; f102_TuDien_DE v_f102_detail = new f102_TuDien_DE(); v_f102_detail.InsertObj(m_us); load_data_2_grid(); } catch (Exception v_e){ CSystemLog_100.ExceptionHandle(v_e); }
private void addNewGiaTriTuDien() { decimal v_dcIDLoaiTD = new decimal(); if (this.isMaTuDienRow(m_fg.Row)) { US_CM_DM_TU_DIEN v_usTD = new US_CM_DM_TU_DIEN(); DataRow v_drTD = (DataRow) (m_fg.Rows[m_fg.Row].UserData); v_usTD.DataRow2Me(v_drTD); v_dcIDLoaiTD = v_usTD.dcID_LOAI_TU_DIEN; } else { v_dcIDLoaiTD = Convert.ToDecimal(m_fg[m_fg.Row, System.Convert.ToInt32(ColNumber.ID)]); } US_CM_DM_TU_DIEN v_usTuDien = new US_CM_DM_TU_DIEN(); v_usTuDien.dcID_LOAI_TU_DIEN = v_dcIDLoaiTD; f102_TuDien_DE v_CalledForm = new f102_TuDien_DE(); if (v_CalledForm.InsertObj(v_usTuDien) == DialogResult.OK) { //add new row to dataset DataRow v_drTuDien = this.m_ds_tu_dien.CM_DM_TU_DIEN.NewRow(); v_usTuDien.Me2DataRow(v_drTuDien); this.m_ds_tu_dien.CM_DM_TU_DIEN.Rows.Add(v_drTuDien); //add new ro to grid int v_iNewGridRowIndex = m_fg.Row + 1; m_fg.Rows.Insert(v_iNewGridRowIndex); this.TuDienDataRow_2_GridRow(v_drTuDien, v_iNewGridRowIndex); } }