コード例 #1
0
        void m_cmd_delete_Click(object sender, EventArgs e)
        {
            try
            {
                if (CHRM_BaseMessages.MsgBox_Confirm(CONST_ID_MSGBOX.QUESTION_XAC_NHAN_XOA_DU_LIEU) == true)
                {
                    DataRow v_dr = m_grv_dm_thue.GetDataRow(m_grv_dm_thue.FocusedRowHandle);
                    decimal v_id_dm_thue = CIPConvert.ToDecimal(v_dr["ID"]);

                    US_DM_THUE v_us = new US_DM_THUE(v_id_dm_thue);
                    v_us.BeginTransaction();
                    v_us.Delete();
                    v_us.CommitTransaction();
                    load_data_2_grid();
                    CHRM_BaseMessages.MsgBox_Infor(CONST_ID_MSGBOX.INFOR_XOA_DU_LIEU_THANH_CONG);
                }
            }
            catch (Exception v_e)
            {
                CSystemLog_301.ExceptionHandle(v_e);
            }
        }
コード例 #2
0
        private void save_data()
        {
            US_DM_THUE v_us_dm_thue = new US_DM_THUE();
            form_2_us_obj(v_us_dm_thue);

            try
            {
                switch (m_e_form_mode)
                {
                    case DataEntryFormMode.InsertDataState:
                        v_us_dm_thue.BeginTransaction();
                        v_us_dm_thue.Insert();
                        v_us_dm_thue.CommitTransaction();
                        m_id_dm_thue_moi_tao = v_us_dm_thue.dcID;
                        if (CHRM_BaseMessages.MsgBox_Confirm(CONST_ID_MSGBOX.QUESTION_INSER_DM_THUE_THANH_CONG_TIEP_TUC_INSERT_YN) == true)
                        {
                            refresh_form();
                        }
                        else
                        {
                            this.Close();
                        }
                        break;
                    case DataEntryFormMode.UpdateDataState:
                        v_us_dm_thue.dcID = m_id_dm_thue_4_update;
                        v_us_dm_thue.BeginTransaction();
                        v_us_dm_thue.Update();
                        v_us_dm_thue.CommitTransaction();
                        CHRM_BaseMessages.MsgBox_Infor(CONST_ID_MSGBOX.INFOR_DU_LIEU_DA_DUOC_CAP_NHAT);
                        this.Close();
                        break;
                    default:
                        break;
                }
            }
            catch (Exception v_e)
            {
                throw v_e;
            }
        }