Example #1
0
        private void rptXuat_khoa_Load(object sender, System.EventArgs e)
        {
            user           = d.user; stime = "'" + d.f_ngay + "'";
            i_dongia       = d.d_dongia_le(i_nhom);
            format_soluong = d.format_soluong(i_nhom);
            sql            = "select a.*, b.stt as sttnhom, b.ten as tennhom from " + user + ".d_dmbd a, " + user + ".d_dmnhom b";
            sql           += " where a.manhom=b.id and a.nhom=" + i_nhom + " order by a.id";
            dt             = d.get_data(sql).Tables[0];

            manguon.DisplayMember = "TEN";
            manguon.ValueMember   = "ID";
            if (d.bQuanlynguon(i_nhom))
            {
                manguon.DataSource = d.get_data("select * from " + user + ".d_dmnguon where nhom=" + i_nhom + " order by stt").Tables[0];
            }
            else
            {
                manguon.DataSource = d.get_data("select * from " + user + ".d_dmnguon where id=0 or nhom=" + i_nhom + " order by stt").Tables[0];
            }

            sql = "select * from " + user + ".d_dmkho where hide=0 and nhom=" + i_nhom;
            if (s_kho != "")
            {
                sql += " and id in (" + s_kho.Substring(0, s_kho.Length - 1) + ")";
            }
            sql                += " order by stt";
            dtdmkho             = d.get_data(sql).Tables[0];
            makho.DataSource    = dtdmkho;
            makho.DisplayMember = "TEN";
            makho.ValueMember   = "ID";
        }
Example #2
0
        private void frmXemtonth_Load(object sender, System.EventArgs e)
        {
            if (bbadt)
            {
                this.Location        = new System.Drawing.Point(188 - 38, 120);//151
                this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                this.Size            = new Size(829 + 40, 610);
            }
            if (Screen.PrimaryScreen.WorkingArea.Width > 800)
            {
                this.WindowState = System.Windows.Forms.FormWindowState.Normal;
            }
            user = d.user;

            /*
             *          s_manguon=d.get_manguon(i_loai).Trim();
             *          s_makho=d.get_dmkho(i_loai).Trim();
             *          if (m.bDanhmuc_nhathuoc && i_nhom==m.nhom_nhathuoc && s_makho!="" && m.kho_nhathuoc!="00:00") //nha thuoc
             *          {
             *                  int hh1=int.Parse(s_ngay.Substring(11,2)),mm1=int.Parse(s_ngay.Substring(14,2)),hh2=int.Parse(m.gio_nhathuoc.Substring(0,2)),mm2=int.Parse(m.gio_nhathuoc.Substring(3,2));
             *                  string kho=m.kho_nhathuoc;
             *                  if (kho!="") kho+=",";
             *                  if (hh1>hh2 || (hh1==hh2 && mm1>mm2)) s_makho=kho;
             *                  else if (kho!="") s_makho=s_makho.Remove(s_makho.IndexOf(kho),kho.Length);
             *          }
             * */
            format_soluong = d.format_soluong(i_nhom);
            load_grid();
            AddGridTableStyle();
        }
Example #3
0
        private void frmTreoduyet_Load(object sender, System.EventArgs e)
        {
            user           = d.user;
            format_soluong = d.format_soluong(i_nhom);
            if (bTutrucchung)
            {
                label3.Text = "Tủ trực :";
            }
            load_ngay_duyet();

            makp.DisplayMember = "TEN";
            makp.ValueMember   = "ID";
            makp.DataSource    = dtkp;
            makp.SelectedValue = i_makp.ToString();
            if (makp.Items.Count > 0)
            {
                kp.Text = dtkp.Rows[makp.SelectedIndex]["ma"].ToString();
            }
            string sql = "select * from " + user + ".d_loaiphieu ";

            if (bThua)
            {
                sql += " where id=0";
            }
            else
            {
                sql += " where nhom=" + i_nhom + " and loai=" + i_loai;
                sql += " and id<>0 order by stt";
            }
            dtph = d.get_data(sql).Tables[0];
            phieudutru.DisplayMember = "TEN";
            phieudutru.ValueMember   = "ID";
            phieudutru.DataSource    = dtph;
            load_phieu();
        }
Example #4
0
 private void frmXemtutructh_Load(object sender, System.EventArgs e)
 {
     if (Screen.PrimaryScreen.WorkingArea.Width > 800)
     {
         this.WindowState = System.Windows.Forms.FormWindowState.Normal;
     }
     user           = d.user; xxx = user + s_mmyy;
     format_soluong = d.format_soluong(i_nhom);
     load_grid();
     AddGridTableStyle();
 }
Example #5
0
        private void frmPttt_thuoc_Load(object sender, System.EventArgs e)
        {
            user = d.user;
            dtdt = m.get_data("select * from " + user + ".d_doituong order by madoituong").Tables[0];
            if (d.bQuanlynguon(i_nhom))
            {
                dtnguon = d.get_data("select * from " + user + ".d_dmnguon where nhom=" + i_nhom + " order by stt").Tables[0];
            }
            else
            {
                dtnguon = d.get_data("select * from " + user + ".d_dmnguon where nhom=0 or nhom=" + i_nhom + " order by stt").Tables[0];
            }
            dsdm.ReadXml("..//..//..//xml//d_tutructh.xml");
            dsdm.Tables[0].Columns.Add("Chon", typeof(bool));
            if (mapt != "")
            {
                foreach (DataRow r in m.get_data("select mavp from " + user + ".dmpttt where mapt='" + mapt + "'").Tables[0].Rows)
                {
                    l_mavp = decimal.Parse(r["mavp"].ToString());
                }
            }
            load_grid();
            AddGridTableStyle();
            f_soluong = d.format_soluong(i_nhom);
            this.disabledBackBrush = new SolidBrush(Color.FromArgb(255, 255, 192));
            this.disabledTextBrush = new SolidBrush(Color.FromArgb(255, 0, 0));

            this.alertBackBrush = new SolidBrush(SystemColors.HotTrack);
            this.alertFont      = new Font(this.dataGrid1.Font.Name, this.dataGrid1.Font.Size, FontStyle.Bold);
            this.alertTextBrush = new SolidBrush(Color.White);

            this.currentRowFont      = new Font(this.dataGrid1.Font.Name, this.dataGrid1.Font.Size, FontStyle.Regular);
            this.currentRowBackBrush = new SolidBrush(Color.FromArgb(0, 255, 255));
            ds.ReadXml("..//..//..//xml//m_pttt_thuoc.xml");
            AddGridTableStyle1();
            load_chitiet();
        }
Example #6
0
        private void frmKhoacstt_Load(object sender, System.EventArgs e)
        {
            s_makho = ""; user = d.user; stime = "'" + d.f_ngay + "'";
            foreach (DataRow r in d.get_data("select kho from " + user + ".d_dmphieu where id=2").Tables[0].Rows)
            {
                s_makho = r["kho"].ToString();
            }

            makho.DisplayMember = "TEN";
            makho.ValueMember   = "ID";
            string sql = "select * from " + user + ".d_dmkho where hide=0 and loai=" + i_loai;

            if (i_loai == 1)
            {
                sql += " and nhom=" + i_nhom;
                if (s_makho != "")
                {
                    sql += " and id in (" + s_makho.Substring(0, s_makho.Length - 1) + ")";
                }
            }
            else
            {
                sql += " and nhom<>" + i_nhom;
                if (s_nhomkho != "")
                {
                    sql += " and nhom in (" + s_nhomkho.Substring(0, s_nhomkho.Length - 1) + ")";
                }
            }
            sql             += " order by stt";
            dtdmkho          = d.get_data(sql).Tables[0];
            makho.DataSource = dtdmkho;
            if (makho.Items.Count > 0)
            {
                makho.SelectedIndex = 0;
            }

            makp.DisplayMember = "TEN";
            makp.ValueMember   = "ID";
            sql = "select * from " + user + ".d_duockp where nhom like '%" + i_nhom.ToString() + ",%'";
            if (s_makp != "")
            {
                string s = s_makp.Replace(",", "','");
                sql += " and makp in ('" + s.Substring(0, s.Length - 3) + "')";
            }
            sql            += " order by stt";
            dtkp            = d.get_data(sql).Tables[0];
            makp.DataSource = dtkp;
            if (makp.Items.Count > 0)
            {
                makp.SelectedIndex = 0;
            }

            ds.ReadXml("..//..//..//xml//d_khoacstt.xml");
            dsxml.ReadXml("..//..//..//xml//d_khoacstt.xml");
            format_soluong = d.format_soluong(i_nhom);
            sql            = "select a.*, b.stt as sttnhom, b.ten as tennhom,c.ten as tenhang,d.ten as nuocsx from " + user + ".d_dmbd a, " + user + ".d_dmnhom b," + user + ".d_dmhang c," + user + ".d_dmnuoc d";
            sql           += " where a.manhom=b.id and a.mahang=c.id and a.manuoc=d.id and a.nhom=" + i_nhom + " order by a.id";
            dt             = d.get_data(sql).Tables[0];

            manguon.DisplayMember = "TEN";
            manguon.ValueMember   = "ID";
            if (d.bQuanlynguon(i_nhom))
            {
                manguon.DataSource = d.get_data("select * from " + user + ".d_dmnguon where nhom=" + i_nhom + " order by stt").Tables[0];
            }
            else
            {
                manguon.DataSource = d.get_data("select * from " + user + ".d_dmnguon where nhom=0 or nhom=" + i_nhom + " order by stt").Tables[0];
            }
        }