Beispiel #1
0
        public List <BJRecord> GetBookByIDMAIN(int IDMAIN, Bases fund)
        {
            if (fund == Bases.BJSCC)
            {
                DA.SelectCommand.CommandText = "select A.*,B.PLAIN from BJSCC..DATAEXT A " +
                                               " left join BJSCC..DATAEXTPLAIN B on A.ID = B.IDDATAEXT where A.IDMAIN = " + IDMAIN;
            }
            else
            {
                DA.SelectCommand.CommandText = "select A.*,B.PLAIN from BJSCC..DATAEXT A " +
                                               " left join BJVVV..DATAEXTPLAIN B on A.ID = B.IDDATAEXT where A.IDMAIN = " + IDMAIN;
            }
            DS = new DataSet();
            DA.Fill(DS, "t");
            List <BJRecord> Book = new List <BJRecord>();
            BJRecord        rec;

            foreach (DataRow r in DS.Tables["t"].Rows)
            {
                rec          = new BJRecord();
                rec.ID       = (int)r["ID"];
                rec.IDDATA   = (int)r["IDDATA"];
                rec.IDINLIST = (int)r["IDINLIST"];
                rec.IDMAIN   = IDMAIN;
                rec.MNFIELD  = (int)r["MNFIELD"];
                rec.MSFIELD  = r["MSFIELD"].ToString();
                rec.PLAIN    = r["PLAIN"].ToString();
                rec.SORT     = r["SORT"].ToString();
                rec.Fund     = fund;
                Book.Add(rec);
            }
            return(Book);
        }
Beispiel #2
0
        public List <BJRecord> GetBookByBAR(string BAR)
        {
            DA.SelectCommand.CommandText = "select A.*,B.PLAIN from BJSCC..DATAEXT A " +
                                           " left join BJSCC..DATAEXTPLAIN B on A.ID = B.IDDATAEXT " +
                                           " where A.IDMAIN = (select top 1 IDMAIN from BJSCC..DATAEXT where MNFIELD = 899 and MSFIELD = '$w' and SORT = '" + BAR + "')";
            DS = new DataSet();
            int   i    = DA.Fill(DS, "t");
            Bases fund = Bases.BJSCC;

            if (i == 0)
            {
                DA.SelectCommand.CommandText = "select A.*,B.PLAIN from BJVVV..DATAEXT A " +
                                               " left join BJVVV..DATAEXTPLAIN B on A.ID = B.IDDATAEXT " +
                                               " where A.IDMAIN = (select top 1 IDMAIN from BJVVV..DATAEXT where MNFIELD = 899 and MSFIELD = '$w' and SORT = '" + BAR + "')";
                fund = Bases.BJVVV;
            }
            DS = new DataSet();
            i  = DA.Fill(DS, "t");

            List <BJRecord> Book = new List <BJRecord>();
            BJRecord        rec;

            foreach (DataRow r in DS.Tables["t"].Rows)
            {
                rec          = new BJRecord();
                rec.ID       = (int)r["ID"];
                rec.IDDATA   = (int)r["IDDATA"];
                rec.IDINLIST = (int)r["IDINLIST"];
                rec.IDMAIN   = (int)r["IDMAIN"];
                rec.MNFIELD  = (int)r["MNFIELD"];
                rec.MSFIELD  = r["MSFIELD"].ToString();
                rec.PLAIN    = r["PLAIN"].ToString();
                rec.SORT     = r["SORT"].ToString();
                rec.Fund     = fund;
                Book.Add(rec);
            }
            return(Book);
        }