Exemplo n.º 1
0
 private void f_Load_Data()
 {
     try
     {
         string sql = "select a.id, trim(a.ma) as ma, trim(a.ten) as ten, 0 as chon,trim(a.dvt) as dvt, a.gia_th, a.gia_bh, a.gia_dv, a.gia_nn, a.gia_cs, trim(b.ten) as tenloai,b.id as id_loai, c.ma as id_nhom, c.ten as tennhom, a.trongoi from medibv.v_giavp a left join medibv.v_loaivp b on a.id_loai=b.id left join medibv.v_nhomvp c on b.id_nhom=c.ma where a.trongoi=0 and a.loaitrongoi=0 order by b.ten,b.stt, b.id, a.ten,a.stt";
         m_dsgiavp     = m_v.get_data(sql);
         m_frmchonvpct = new frmChonvpct(m_v, m_userid, "GIA_TH", m_dsgiavp);
         m_frmchonvpct.ShowInTaskbar = false;
     }
     catch
     {
     }
 }
Exemplo n.º 2
0
        private void f_Load_Data()
        {
            try
            {
                string sql = "";
                sql  = "select a.id, trim(a.ma) as ma, trim(a.ten) as ten, 0 as chon,trim(a.dvt) as dvt, a.gia_th, ";
                sql += "a.gia_bh, a.gia_dv, a.gia_nn, a.gia_cs, trim(b.ten) as tenloai,b.id as id_loai, ";
                sql += "c.ma as id_nhom, c.ten as tennhom, a.trongoi from medibv.v_giavp a left join ";
                sql += "medibv.v_loaivp b on a.id_loai=b.id left join medibv.v_nhomvp c on b.id_nhom=c.ma ";
                sql += "where a.trongoi=0 and a.loaitrongoi=0 ";
                //TU:09/05/2011
                sql += "union all ";
                sql += "select a.id, trim(a.ma) as ma, trim(a.ten) as ten, 0 as chon,trim(dang) as dvt,a.giaban as gia_th,";
                sql += "gia_bh,0 as gia_dv,0 as gia_nn,0 as gia_cs,'" + lan.Change_language_MessageText("Thuốc") + "' as tenloai,-999 as id_loai,";//-999 as id_loai
                sql += "c.ma as id_nhom, '" + lan.Change_language_MessageText("Thuốc") + "' as tennhom,0 as trongoi from " + m_v.user + ".d_dmbd a," + m_v.user + ".d_dmnhom b, ";
                sql += "" + m_v.user + ".v_nhomvp c where a.manhom=b.id and b.nhomvp=c.ma ";
                //end Tu
                //sql+="order by b.ten,b.stt, b.id, a.ten,a.stt";
                sql          += "order by ten, id, ten";
                m_dsgiavp     = m_v.get_data(sql);
                m_frmchonvpct = new frmChonvpct(m_v, m_userid, "GIA_TH", m_dsgiavp);
                m_frmchonvpct.ShowInTaskbar = false;

                ds_dt           = m_v.get_data("select madoituong,doituong from " + m_v.user + ".doituong order by madoituong");
                r               = ds_dt.Tables[0].NewRow();
                r["madoituong"] = "0";
                r["doituong"]   = " ";
                ds_dt.Tables[0].Rows.InsertAt(r, 0);

                Col_dt.DataSource       = ds_dt.Tables[0];
                Col_dt.DisplayMember    = "doituong";
                Col_dt.ValueMember      = "madoituong";
                Col_dt.DataPropertyName = "madoituong";
                try
                {
                    DataSet ds_tile = m_v.get_data("select giatri from " + m_v.user + ".v_option where ma='nrcMienGiam'");
                    txtTiLe.Value = int.Parse(ds_tile.Tables[0].Rows[0][0].ToString());
                }
                catch { txtTiLe.Value = 0; }
            }
            catch
            {
            }
        }