Beispiel #1
0
        private void butIn_Click(object sender, System.EventArgs e)
        {
            taotable();
            if (dsxml.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), d.Msg);
                tu.Focus();
                return;
            }
            if (s_makho != "")
            {
                s_makho = s_makho.Substring(0, s_makho.Length - 1);
            }
            id = d.get_id_phieuxuat(tu.Text, int.Parse(makp.SelectedValue.ToString()), i_nhom, s_loai, s_phieu, s_makho, s_mmyy);
            if (id == 0)
            {
                id   = d.get_id_phieuxuat();
                soct = d.get_phieuxuat(s_mmyy, i_nhom, s_makho);
            }
            else
            {
                soct = d.get_phieuxuat(s_mmyy, id);
            }
            d.upd_phieuxuat(s_mmyy, id, soct, tu.Text, int.Parse(makp.SelectedValue.ToString()), i_nhom, s_loai, s_phieu, s_makho, d_tongcong, "", "", makp.Text, i_userid);
            string s_tndn = tu.Text;

            if (chkxml.Checked)
            {
                if (System.IO.Directory.Exists("..\\..\\dataxml") == false)
                {
                    System.IO.Directory.CreateDirectory("..\\..\\dataxml");
                }
                dsxml.WriteXml("..\\..\\dataxml\\d_dphieuxuatkho.xml", XmlWriteMode.WriteSchema);
            }
            frmReport f = new frmReport(d, dsxml.Tables[0], i_userid, "d_phieuxuat.rpt", soct, s_tndn, "", "", makp.Text, "Xuất sử dụng", s_tenkho, doiso.Doiso_Unicode(Convert.ToInt64(d_tongcong).ToString()), "", "");

            f.ShowDialog();
        }
Beispiel #2
0
        private void butIn_Click(object sender, System.EventArgs e)
        {
            string sql1;

            s_loai = ""; s_phieu = "";
            for (int i = 0; i < loai.Items.Count; i++)
            {
                if (loai.GetItemChecked(i))
                {
                    s_loai += dtloai.Rows[i]["id"].ToString().Trim() + ",";
                }
            }
            for (int i = 0; i < phieu.Items.Count; i++)
            {
                if (phieu.GetItemChecked(i))
                {
                    s_phieu += dtphieu.Rows[i]["id"].ToString().Trim() + ",";
                }
            }
            sql  = "select * from xxx.d_daduyet where nhom=" + int.Parse(nhom.SelectedValue.ToString());
            sql += " and ngay between to_date('" + tu.Text + "'," + stime + ") and to_date('" + den.Text + "'," + stime + ")";
            sql += " and makp=" + int.Parse(makp.SelectedValue.ToString());
            if (s_makho != "")
            {
                sql += " and makho in (" + s_makho.Substring(0, s_makho.Length - 1) + ")";
            }
            if (d.get_thuoc(tu.Text, den.Text, sql).Tables[0].Rows.Count == 0)
            {
                MessageBox.Show(
                    lan.Change_language_MessageText("Không có số liệu !"), d.Msg);
                tu.Focus();
                return;
            }
            sql1 = sql;
            sql  = "select * from xxx.d_duyet where loai<>2 and done=1 and nhom=" + int.Parse(nhom.SelectedValue.ToString());
            sql += " and makhoa=" + int.Parse(makp.SelectedValue.ToString());
            sql += " and ngay between to_date('" + tu.Text + "'," + stime + ") and to_date('" + den.Text + "'," + stime + ")";
            if (s_loai != "")
            {
                sql += " and loai in (" + s_loai.Substring(0, s_loai.Length - 1) + ")";
            }
            if (s_phieu != "")
            {
                sql += " and phieu in (" + s_phieu.Substring(0, s_phieu.Length - 1) + ")";
            }
            if (d.get_thuoc(tu.Text, den.Text, sql).Tables[0].Rows.Count > 0)
            {
                MessageBox.Show(
                    lan.Change_language_MessageText("Số liệu kho chưa duyệt xong !"), d.Msg);
                tu.Focus();
                return;
            }
            taotable();
            if (dsxml.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show(
                    lan.Change_language_MessageText("Không có số liệu !"), d.Msg);
                tu.Focus();
                return;
            }
            s_mmyy = d.get_mmyy(tu.Text, den.Text, sql1);
            if (s_mmyy == "")
            {
                s_mmyy = d.mmyy(tu.Text);
            }
            if (s_makho != "")
            {
                s_makho = s_makho.Substring(0, s_makho.Length - 1);
            }
            id = d.get_id_phieuxuat(tu.Text, int.Parse(makp.SelectedValue.ToString()), i_nhom, s_loai, s_phieu, s_makho, s_mmyy);
            if (id == 0)
            {
                id   = d.get_id_phieuxuat();
                soct = d.get_phieuxuat(s_mmyy, i_nhom, s_makho);
            }
            else
            {
                soct = d.get_phieuxuat(s_mmyy, id);
            }
            d.upd_phieuxuat(s_mmyy, id, soct, tu.Text, int.Parse(makp.SelectedValue.ToString()), i_nhom, s_loai, s_phieu, s_makho, d_tongcong, "", "", "", i_userid);
            string s_tndn = tu.Text;

            dllReportM.frmReport f = new dllReportM.frmReport(m, dsxml.Tables[0], "d_phieuxuat.rpt", soct, s_tndn, "", "", makp.Text, "Xuất sử dụng", s_tenkho, doiso.doiraso(Convert.ToInt64(d_tongcong).ToString()), "", "");
            f.ShowDialog();
        }