Beispiel #1
0
		private static SO_vNWS_Content[] getRecord(
			DataTable dataTable_in
		) {
			DataColumn _dc_idcontent = null;
			DataColumn _dc_idlanguage = null;
			DataColumn _dc_ifuser__publisher = null;
			DataColumn _dc_publishername = null;
			DataColumn _dc_publish_date = null;
			DataColumn _dc_ifuser__approved = null;
			DataColumn _dc_approved_date = null;
			DataColumn _dc_title = null;
			DataColumn _dc_content = null;
			DataColumn _dc_subtitle = null;
			DataColumn _dc_summary = null;

			SO_vNWS_Content[] _output 
				= new SO_vNWS_Content[dataTable_in.Rows.Count];
			for (int r = 0; r < dataTable_in.Rows.Count; r++) {
				if (r == 0) {
					_dc_idcontent = dataTable_in.Columns["IDContent"];
					_dc_idlanguage = dataTable_in.Columns["IDLanguage"];
					_dc_ifuser__publisher = dataTable_in.Columns["IFUser__Publisher"];
					_dc_publishername = dataTable_in.Columns["PublisherName"];
					_dc_publish_date = dataTable_in.Columns["Publish_date"];
					_dc_ifuser__approved = dataTable_in.Columns["IFUser__Approved"];
					_dc_approved_date = dataTable_in.Columns["Approved_date"];
					_dc_title = dataTable_in.Columns["Title"];
					_dc_content = dataTable_in.Columns["Content"];
					_dc_subtitle = dataTable_in.Columns["subtitle"];
					_dc_summary = dataTable_in.Columns["summary"];
				}

				_output[r] = new SO_vNWS_Content();
				if (dataTable_in.Rows[r][_dc_idcontent] == System.DBNull.Value) {
					_output[r].IDContent = 0L;
				} else {
					_output[r].IDContent = (long)dataTable_in.Rows[r][_dc_idcontent];
				}
				if (dataTable_in.Rows[r][_dc_idlanguage] == System.DBNull.Value) {
					_output[r].IDLanguage = 0;
				} else {
					_output[r].IDLanguage = (int)dataTable_in.Rows[r][_dc_idlanguage];
				}
				if (dataTable_in.Rows[r][_dc_ifuser__publisher] == System.DBNull.Value) {
					_output[r].IFUser__Publisher = 0L;
				} else {
					_output[r].IFUser__Publisher = (long)dataTable_in.Rows[r][_dc_ifuser__publisher];
				}
				if (dataTable_in.Rows[r][_dc_publishername] == System.DBNull.Value) {
					_output[r].PublisherName_isNull = true;
				} else {
					_output[r].PublisherName = (string)dataTable_in.Rows[r][_dc_publishername];
				}
				if (dataTable_in.Rows[r][_dc_publish_date] == System.DBNull.Value) {
					_output[r].Publish_date = new DateTime(1900, 1, 1);
				} else {
					_output[r].Publish_date = (DateTime)dataTable_in.Rows[r][_dc_publish_date];
				}
				if (dataTable_in.Rows[r][_dc_ifuser__approved] == System.DBNull.Value) {
					_output[r].IFUser__Approved_isNull = true;
				} else {
					_output[r].IFUser__Approved = (long)dataTable_in.Rows[r][_dc_ifuser__approved];
				}
				if (dataTable_in.Rows[r][_dc_approved_date] == System.DBNull.Value) {
					_output[r].Approved_date_isNull = true;
				} else {
					_output[r].Approved_date = (DateTime)dataTable_in.Rows[r][_dc_approved_date];
				}
				if (dataTable_in.Rows[r][_dc_title] == System.DBNull.Value) {
					_output[r].Title_isNull = true;
				} else {
					_output[r].Title = (string)dataTable_in.Rows[r][_dc_title];
				}
				if (dataTable_in.Rows[r][_dc_content] == System.DBNull.Value) {
					_output[r].Content_isNull = true;
				} else {
					_output[r].Content = (string)dataTable_in.Rows[r][_dc_content];
				}
				if (dataTable_in.Rows[r][_dc_subtitle] == System.DBNull.Value) {
					_output[r].subtitle_isNull = true;
				} else {
					_output[r].subtitle = (string)dataTable_in.Rows[r][_dc_subtitle];
				}
				if (dataTable_in.Rows[r][_dc_summary] == System.DBNull.Value) {
					_output[r].summary_isNull = true;
				} else {
					_output[r].summary = (string)dataTable_in.Rows[r][_dc_summary];
				}

				_output[r].HasChanges = false;
			}

			return _output;
		}
Beispiel #2
0
		public static DataTable getDataTable(
			SO_vNWS_Content[] serializableObjects_in
		) {
			DataTable _output = new DataTable();
			_output.Locale = System.Globalization.CultureInfo.CurrentCulture;
			DataRow _dr;

			DataColumn _dc_idcontent = new DataColumn("IDContent", typeof(long));
			_output.Columns.Add(_dc_idcontent);
			DataColumn _dc_idlanguage = new DataColumn("IDLanguage", typeof(int));
			_output.Columns.Add(_dc_idlanguage);
			DataColumn _dc_ifuser__publisher = new DataColumn("IFUser__Publisher", typeof(long));
			_output.Columns.Add(_dc_ifuser__publisher);
			DataColumn _dc_publishername = new DataColumn("PublisherName", typeof(string));
			_output.Columns.Add(_dc_publishername);
			DataColumn _dc_publish_date = new DataColumn("Publish_date", typeof(DateTime));
			_output.Columns.Add(_dc_publish_date);
			DataColumn _dc_ifuser__approved = new DataColumn("IFUser__Approved", typeof(long));
			_output.Columns.Add(_dc_ifuser__approved);
			DataColumn _dc_approved_date = new DataColumn("Approved_date", typeof(DateTime));
			_output.Columns.Add(_dc_approved_date);
			DataColumn _dc_title = new DataColumn("Title", typeof(string));
			_output.Columns.Add(_dc_title);
			DataColumn _dc_content = new DataColumn("Content", typeof(string));
			_output.Columns.Add(_dc_content);
			DataColumn _dc_subtitle = new DataColumn("subtitle", typeof(string));
			_output.Columns.Add(_dc_subtitle);
			DataColumn _dc_summary = new DataColumn("summary", typeof(string));
			_output.Columns.Add(_dc_summary);

			foreach (SO_vNWS_Content _serializableObject in serializableObjects_in) {
				_dr = _output.NewRow();

				_dr[_dc_idcontent] = _serializableObject.IDContent;
				_dr[_dc_idlanguage] = _serializableObject.IDLanguage;
				_dr[_dc_ifuser__publisher] = _serializableObject.IFUser__Publisher;
				_dr[_dc_publishername] = _serializableObject.PublisherName;
				_dr[_dc_publish_date] = _serializableObject.Publish_date;
				_dr[_dc_ifuser__approved] = _serializableObject.IFUser__Approved;
				_dr[_dc_approved_date] = _serializableObject.Approved_date;
				_dr[_dc_title] = _serializableObject.Title;
				_dr[_dc_content] = _serializableObject.Content;
				_dr[_dc_subtitle] = _serializableObject.subtitle;
				_dr[_dc_summary] = _serializableObject.summary;

				_output.Rows.Add(_dr);
			}

			return _output;
		}