Пример #1
0
        public static PluginZone SelectById(Int32 PZ_ID)
        {
            PluginZone Item = new PluginZone();

            SqlParameter[] obj = new SqlParameter[1];
            obj[0] = new SqlParameter("PZ_ID", PZ_ID);
            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblPluginZone_Select_SelectById_hoangda", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
Пример #2
0
        public static PluginZone UpdateMove(string id, string z_id, string thuTu)
        {
            PluginZone Item = new PluginZone();

            SqlParameter[] obj = new SqlParameter[3];
            obj[0] = new SqlParameter("PZ_ID", id);
            obj[1] = new SqlParameter("PZ_Z_ID", z_id);
            obj[2] = new SqlParameter("PZ_ThuTu", thuTu);
            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblPluginZone_Update_UpdateMove_hoangda", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
Пример #3
0
        public static PluginZone Insert(PluginZone Inserted)
        {
            PluginZone Item = new PluginZone();

            SqlParameter[] obj = new SqlParameter[3];
            obj[0] = new SqlParameter("PZ_Z_ID", Inserted.Z_ID);
            obj[1] = new SqlParameter("PZ_Settings", Inserted.Settings);
            obj[2] = new SqlParameter("PZ_ThuTu", Inserted.ThuTu);

            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblPluginZone_Insert_InsertNormal_hoangda", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
Пример #4
0
        public static PluginZone getFromReader(IDataReader rd)
        {
            PluginZone Item = new PluginZone();

            if (rd.FieldExists("PZ_ID"))
            {
                Item.ID = (Int32)(rd["PZ_ID"]);
            }
            if (rd.FieldExists("PZ_Z_ID"))
            {
                Item.Z_ID = (Int32)(rd["PZ_Z_ID"]);
            }
            if (rd.FieldExists("PZ_Settings"))
            {
                Item.Settings = (String)(rd["PZ_Settings"]);
            }
            if (rd.FieldExists("PZ_ThuTu"))
            {
                Item.ThuTu = (Int32)(rd["PZ_ThuTu"]);
            }
            return(Item);
        }