示例#1
0
        public static DashboardDTO ConvertDashboardTable_To_DTO(tblDashboard dashboard)
        {
            DashboardDTO dto_Dashboard = new DashboardDTO();

            try
            {
                dto_Dashboard.Id                = dashboard.Id;
                dto_Dashboard.Layout_Option     = dashboard.Layout_Option;
                dto_Dashboard.Is_Deleted        = dashboard.Is_Deleted;
                dto_Dashboard.Accessibility     = (Accessibility_Type)Enums.TryParse(typeof(Accessibility_Type), dashboard.Accessibility.ToString());
                dto_Dashboard.Widget_Positions  = dashboard.Widget_Positions;
                dto_Dashboard.Title             = dashboard.Title;
                dto_Dashboard.Parent_Id         = dashboard.Parent_Id;
                dto_Dashboard.Dashboard_Type    = (DashboardType)Enum.Parse(typeof(DashboardType), dashboard.Dashboard_Type);
                dto_Dashboard.Dashboard_Widgets = Dashboard_Widget_DTO_Convert.Dashboard_Widget_DTO_Convert_List_Table_To_DTO(dashboard.tblDashboard_Widget);
            }
            catch { }

            return(dto_Dashboard);
        }
示例#2
0
        public static tblDashboard ConvertDashboardDTO_To_Table(DashboardDTO dashboard)
        {
            tblDashboard tbl_Dashboard = new tblDashboard();

            tbl_Dashboard.Id            = dashboard.Id;
            tbl_Dashboard.Layout_Option = dashboard.Layout_Option;
            tbl_Dashboard.Is_Deleted    = dashboard.Is_Deleted;


            if (dashboard.Accessibility == 0)
            {
                tbl_Dashboard.Accessibility = Accessibility_Type.Private.ToString();
            }
            else
            {
                tbl_Dashboard.Accessibility = dashboard.Accessibility.ToString();
            }


            tbl_Dashboard.Parent_Id      = dashboard.Parent_Id;
            tbl_Dashboard.Title          = dashboard.Title;
            tbl_Dashboard.Dashboard_Type = dashboard.Dashboard_Type.ToString();
            return(tbl_Dashboard);
        }