Пример #1
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            int i = m_v.check_process("Vienphi"), iProcess = int.Parse(m_v.sys_sokichhoat);

            if (i > iProcess)
            {
                MessageBox.Show(this, "Số chương trình kích hoạt : " + i.ToString() + " nhiều hơn cho phép :" + iProcess.ToString(), m_v.s_AppName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                Application.Exit();
            }
            this.Text = this.Text + " - Version: " + ProductVersion;
            if (m_v.i_Chinhanh_hientai > 0)
            {
                this.Text += " - CN: " + m_v.i_Chinhanh_hientai;
            }

            //tan_start:18/10/2013
            if (__userid != "")
            {
                f_LoginFull();
            }

            if (m_userid == "")
            {
                f_Login(true);
            }
            //tan_end:18/10/2013

            //thang 070511
            string sql = "";

            sql = "SELECT relname FROM pg_class  WHERE relname = 'v_dmloaibc'";
            DataSet lds = m_v.get_data(sql);

            if (lds == null || lds.Tables[0].Rows.Count == 0)
            {
                sql = "create table medibv.v_dmloaibc (id serial,maloai_bc numeric default 0,tenloaibc varchar(100), primary key (id) )";
                m_v.execute_data(sql);
                sql = ",Bó bột,SĐ Kế hoạch";
                string[] arr_string = sql.Split(',');
                for (int i1 = 0; i1 < arr_string.Length; i1++)
                {
                    m_v.execute_data("insert into medibv.v_dmloaibc(maloai_bc,tenloaibc) values(" + i1.ToString() + ",'" + arr_string[i1].ToString() + "')");
                }
            }
            if (m_v.bhyt_thuBHYT_tructiep(m_userid))
            {
                toolStripMenuItem18.Text = "&2. Thu viện phí";
            }
            else
            {
                toolStripMenuItem18.Text = "&2. Thu viện phí BHYT Ngoại trú";
            }
        }