Пример #1
0
 private void f_Load_Sua()
 {
     try
     {
         if (m_id != "")
         {
             string atmp = m_id;
             m_id = "";
             foreach (DataRow r in m_v.f_get_v_nhombhyt(atmp, "", "", "", "").Tables[0].Rows)
             {
                 m_id                = r["id"].ToString();
                 txtID.Text          = r["id"].ToString();
                 txtStt.Text         = r["stt"].ToString();
                 txtTen.Text         = r["ten"].ToString();
                 txtViettat.Text     = r["viettat"].ToString();
                 chkReadonly.Checked = r["readonly"].ToString() == "1";
                 txtStt.Focus();
                 break;
             }
         }
     }
     catch
     {
     }
 }
Пример #2
0
 private void f_Load_CB_Nhombhyt()
 {
     try
     {
         DataSet ads = m_v.f_get_v_nhombhyt("", "", "", "", "");
         if (ads.Tables[0].Select("id=-1").Length <= 0)
         {
             DataRow r = ads.Tables[0].NewRow();
             r["id"]  = -1;
             r["ten"] = "...";
             ads.Tables[0].Rows.InsertAt(r, ads.Tables[0].Rows.Count);
         }
         cbNhombhyt.DisplayMember = "TEN";
         cbNhombhyt.ValueMember   = "ID";
         cbNhombhyt.DataSource    = ads.Tables[0];
         cbNhombhyt.SelectedValue = m_id_nhombhyt;
     }
     catch
     {
     }
 }
Пример #3
0
        private void f_Load_CB_Nhombhyt()
        {
            try
            {
                DataSet ads_nhomvp = m_v.f_get_v_nhomvp_frmnhomvp();
                if (ads_nhomvp.Tables[0].Rows.Count <= 0)
                {
                    if (MessageBox.Show(this, lan.Change_language_MessageText("Chưa khai nhóm viện phí!") + "\n" + lan.Change_language_MessageText("Có muốn hệ thống tạo nhóm mặc định không?"), m_v.s_AppName, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                    {
                        m_v.f_default_nhombhyt();
                        m_v.f_default_nhomvp();
                        ads_nhomvp = m_v.f_get_v_nhomvp_frmnhomvp();
                    }
                }
                DataSet ads = m_v.f_get_v_nhombhyt("", "", "", "", "");

                treeView1.Nodes.Clear();
                TreeNode anode;
                foreach (DataRow r in ads.Tables[0].Select("", "ten"))
                {
                    anode                    = new TreeNode(r["ten"].ToString());
                    anode.ImageIndex         = 0;
                    anode.SelectedImageIndex = 1;
                    anode.Tag                = r["id"].ToString();
                    treeView1.Nodes.Add(anode);
                }
                if (ads_nhomvp.Tables[0].Select("idnhombhyt=-999").Length > 0)
                {
                    anode                    = new TreeNode(lan.Change_language_MessageText("{Chưa khai nhóm BHYT}"));
                    anode.Tag                = "-1";
                    anode.ImageIndex         = 2;
                    anode.SelectedImageIndex = 2;
                    treeView1.Nodes.Add(anode);
                }
                if (treeView1.Nodes.Count > 1)
                {
                    anode = new TreeNode(
                        lan.Change_language_MessageText("{Tất cả}"));
                    anode.Tag                = "-1";
                    anode.ImageIndex         = 3;
                    anode.SelectedImageIndex = 3;
                    treeView1.Nodes.Add(anode);
                }
                if (treeView1.Nodes.Count > 0)
                {
                    treeView1.SelectedNode = treeView1.Nodes[treeView1.Nodes.Count - 1];
                }

                if (ads.Tables[0].Select("id=-1").Length <= 0)
                {
                    DataRow r = ads.Tables[0].NewRow();
                    r["id"]  = -1;
                    r["ten"] = "...";
                    ads.Tables[0].Rows.InsertAt(r, ads.Tables[0].Rows.Count);
                }
                cbNhombhyt.DisplayMember = "TEN";
                cbNhombhyt.ValueMember   = "ID";
                cbNhombhyt.DataSource    = ads.Tables[0];

                dataGridView1.DataSource = ads_nhomvp.Tables[0];
                toolStrip_Tim_TextChanged(null, null);
            }
            catch
            {
            }
        }