Ejemplo n.º 1
0
        public BlaDBVariantDefinition(DBConnectionPool conn, BlaRequest req)
        {
            Year   = req.Slice.Year;
            iModel = req.Slice.Model;
            var com = new SqlCommand(
                "select LX3050, LX418C, LX428C, LX468P, LX418P, LX428P, LX468K, LX118R, LX338V, Nazwa from [mgm].[F7210_H02_VarRecord] (@Project, @Year, @Model" +
                (req.Slice.Variant != null ? ", @Variant" : ", null") + ")", conn.Connection);

            com.Parameters.AddWithValue("@Project", req.Slice.ProjectID);
            com.Parameters.AddWithValue("@Year", req.Slice.Year);
            com.Parameters.AddWithValue("@Model", req.Slice.Model);
            if (req.Slice.Variant != null)
            {
                var spa = com.Parameters.AddWithValue("@Variant", req.Slice.Variant);
                spa.DbType = DbType.Int32;
            }

            var r = com.ExecuteReader();

            if (!r.Read())
            {
                throw new ArgumentException("Nie można odczytać tabeli wariantów");
            }
            iLX3050 = r.GetInt32(0);
            iLX418C = r.GetInt32(1);
            iLX428C = r.GetInt32(2);
            iLX468P = r.GetInt32(3);
            iLX418P = r.GetInt32(4);
            iLX428P = r.GetInt32(5);
            iLX468K = r.GetInt32(6);
            iLX118R = r.GetInt32(7);
            iLX338V = r.GetInt32(8);
            Nazwa   = r.IsDBNull(9) ? "" : r.GetString(9);
        }
Ejemplo n.º 2
0
        //public GrWAtt_Values AttValues = new GrWAtt_Values();

        public BlaCommonStorage(DBConnectionPool pool, BlaRequest request = null)
        {
            Attributies = new GrWAttributies();
            //WorkMode = workMode;
            Request      = request;
            EntityReader = new JohEntityReader(pool);
            PuT          = new PuTModel(this);
        }