Example #1
0
        public List <CableVO> GetPackageForVO(int IDWP)
        {
            DA.SelectCommand.Parameters.AddWithValue("IDWP", IDWP);
            DA.SelectCommand.CommandText = " select A.IDCABLE id,A.ID nn,B.CABLENAME name,A.CNT " +
                                           " from " + Base.BaseName + "..CABLES A " +
                                           " left join " + Base.BaseName + "..CABLELIST B ON B.ID = A.IDCABLE " +
                                           "  where IDWP = @IDWP ";
            DA.Fill(DS, "t");
            List <CableVO> ret = new List <CableVO>();

            foreach (DataRow r in DS.Tables["t"].Rows)
            {
                ret.Add(CableVO.GetCableVOByID((int)r["id"]));
            }

            return(ret);
        }
Example #2
0
        public static IProduct Create(int ID, string WPTYPE)
        {
            switch (WPTYPE)
            {
            case "WPNAMELIST":
                return(WPNameVO.WPNameVOByID(ID));

            case "ZHGUTLIST":
                return(ZhgutVO.GetZhgutVOByID(ID));

            case "CABLELIST":
                return(CableVO.GetCableVOByID(ID));
            }
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("Неизвестный тип продукта : \"{0}\"!", WPTYPE);

            throw new Exception(sb.ToString());
        }