Ejemplo n.º 1
0
        public static TopicTin getFromReader(IDataReader rd)
        {
            TopicTin Item  = new TopicTin();
            Tin      _Item = new Tin();

            _Item = TinDal.getFromReader(rd);
            if (rd.FieldExists("TPT_ID"))
            {
                Item.ID = (Int32)(rd["TPT_ID"]);
            }
            if (rd.FieldExists("TPT_TP_ID"))
            {
                Item.TP_ID = (Int32)(rd["TPT_TP_ID"]);
            }
            if (rd.FieldExists("TPT_T_ID"))
            {
                Item.T_ID = (Int32)(rd["TPT_T_ID"]);
            }
            if (rd.FieldExists("TPT_ThuTu"))
            {
                Item.ThuTu = (Int32)(rd["TPT_ThuTu"]);
            }
            Item._Tin = _Item;
            return(Item);
        }
Ejemplo n.º 2
0
        public static TopicTin SelectById(Int32 TPT_ID)
        {
            TopicTin Item = new TopicTin();

            SqlParameter[] obj = new SqlParameter[1];
            obj[0] = new SqlParameter("TPT_ID", TPT_ID);
            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "tblRss_sp_tblRssTopicTin_Select_SelectById_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
Ejemplo n.º 3
0
        public static TopicTin Update(Int32?id, Int32?tp_id, Int32?t_id, Int32?thutu)
        {
            TopicTin Item = new TopicTin();

            SqlParameter[] obj = new SqlParameter[4];
            if (id != null)
            {
                obj[0] = new SqlParameter("TPT_ID", id);
            }
            else
            {
                obj[0] = new SqlParameter("TPT_ID", DBNull.Value);
            }
            if (tp_id != null)
            {
                obj[1] = new SqlParameter("TPT_TP_ID", tp_id);
            }
            else
            {
                obj[1] = new SqlParameter("TPT_TP_ID", DBNull.Value);
            }
            if (t_id != null)
            {
                obj[2] = new SqlParameter("TPT_T_ID", t_id);
            }
            else
            {
                obj[2] = new SqlParameter("TPT_T_ID", DBNull.Value);
            }
            if (thutu != null)
            {
                obj[3] = new SqlParameter("TPT_ThuTu", thutu);
            }
            else
            {
                obj[3] = new SqlParameter("TPT_ThuTu", DBNull.Value);
            }

            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "tblRss_sp_tblRssTopicTin_Update_UpdateNormal_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
Ejemplo n.º 4
0
        public static TopicTin Insert(TopicTin Inserted)
        {
            TopicTin Item = new TopicTin();

            SqlParameter[] obj = new SqlParameter[3];
            obj[0] = new SqlParameter("TPT_TP_ID", Inserted.TP_ID);
            obj[1] = new SqlParameter("TPT_T_ID", Inserted.T_ID);
            obj[2] = new SqlParameter("TPT_ThuTu", Inserted.ThuTu);

            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "tblRss_sp_tblRssTopicTin_Insert_InsertNormal_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }