Ejemplo n.º 1
0
        /// <summary>adds data to the DataRowView</summary>
        static public TemplateElement FromRowView(DataRowView row)
        {
            TemplateElement model = new TemplateElement();

            if (row == null)
            {
                return(model);
            }
//			Debug.Print(
//				"LOADED TEMPLATE ROW, Type: {0}, Value: {1}",
//				row[col_id].GetType(),
//				row[col_id]
//			);
            if (row[col_id] != DBNull.Value)
            {
                model.Id = Convert.ToInt32(row[col_id]);
            }
            if (row[col_admin] != DBNull.Value)
            {
                model.Admin = row[col_admin] as string;
            }
            if (row[col_table] != DBNull.Value)
            {
                model.Table = row[col_table] as string;
            }
            if (row[col_title] != DBNull.Value)
            {
                model.Title = row[col_title] as string;
            }
            if (row[col_container] != DBNull.Value)
            {
                model.Container = row[col_container] as string;
            }
            if (row[col_row] != DBNull.Value)
            {
                model.Row = row[col_row] as string;
            }
            if (row[col_head] != DBNull.Value)
            {
                model.Head = row[col_head] as string;
            }
            if (row[col_foot] != DBNull.Value)
            {
                model.Foot = row[col_foot] as string;
            }
            if (row[col_grouphead] != DBNull.Value)
            {
                model.Grouphead = row[col_grouphead] as string;
            }
            if (row[col_groupfoot] != DBNull.Value)
            {
                model.Groupfoot = row[col_groupfoot] as string;
            }
            if (row[col_note] != DBNull.Value)
            {
                model.Note = row[col_note] as string;
            }
            return(model);
        }
Ejemplo n.º 2
0
 /// <summary>adds data to the DataRowView</summary>
 static public void ToRowView(TemplateElement model, DataRowView row)
 {
     row[col_id]        = model.Id;
     row[col_admin]     = model.Admin;
     row[col_table]     = model.Table;
     row[col_title]     = model.Title;
     row[col_container] = model.Container;
     row[col_row]       = model.Row;
     row[col_head]      = model.Head;
     row[col_foot]      = model.Foot;
     row[col_grouphead] = model.Grouphead;
     row[col_groupfoot] = model.Groupfoot;
     row[col_note]      = model.Note;
 }