Esempio n. 1
0
        public static ChartGaugeDTO ChartGaugeDTO_Convert_Table_To_DTO(tblChart_Gauge tbl_chart_gauge)
        {
            ChartGaugeDTO chart_gauge_dto = new ChartGaugeDTO();

            try
            {
                chart_gauge_dto.Dashboard_Widget_Id = tbl_chart_gauge.DashboardWidget_Id;
                chart_gauge_dto.End_Angle           = tbl_chart_gauge.End_Angle;
                chart_gauge_dto.Id                  = tbl_chart_gauge.Id;
                chart_gauge_dto.Max                 = tbl_chart_gauge.Max;
                chart_gauge_dto.Metric.Id           = tbl_chart_gauge.Metric_Id;
                chart_gauge_dto.Metric_Label        = tbl_chart_gauge.Metric_Label;
                chart_gauge_dto.Min                 = tbl_chart_gauge.Min;
                chart_gauge_dto.Minor_Unit          = tbl_chart_gauge.Minor_Unit;
                chart_gauge_dto.Start_Angle         = tbl_chart_gauge.Start_Angle;
                chart_gauge_dto.Target_Matric.Id    = tbl_chart_gauge.Target_Matric_Id;
                chart_gauge_dto.Target_Matric_Label = tbl_chart_gauge.Target_Matric_Label;

                chart_gauge_dto.Chart_Common_Property_DTO.From_Date = tbl_chart_gauge.From_Date;
                if (tbl_chart_gauge.Time_Line != null)
                {
                    chart_gauge_dto.Chart_Common_Property_DTO.Time_Line = (TimeLine)Enums.TryParse(typeof(TimeLine), tbl_chart_gauge.Time_Line);
                }
                chart_gauge_dto.Chart_Common_Property_DTO.To_Date   = tbl_chart_gauge.To_Date;
                chart_gauge_dto.Chart_Common_Property_DTO.Precision = tbl_chart_gauge.Precision;
            }
            catch (Exception ex)
            {
            }
            return(chart_gauge_dto);
        }
Esempio n. 2
0
        public static tblChart_Gauge ChartGaugeDTO_Convert_DTO_To_Table(ChartGaugeDTO chart_gauge_dto)
        {
            if (chart_gauge_dto != null)
            {
                tblChart_Gauge tbl_chart_gauge = new tblChart_Gauge();
                try
                {
                    tbl_chart_gauge.DashboardWidget_Id = chart_gauge_dto.Dashboard_Widget_Id;
                    tbl_chart_gauge.End_Angle          = chart_gauge_dto.End_Angle;
                    tbl_chart_gauge.Id                  = chart_gauge_dto.Id;
                    tbl_chart_gauge.Max                 = chart_gauge_dto.Max;
                    tbl_chart_gauge.Metric_Id           = chart_gauge_dto.Metric.Id;
                    tbl_chart_gauge.Metric_Label        = chart_gauge_dto.Metric_Label;
                    tbl_chart_gauge.Min                 = chart_gauge_dto.Min;
                    tbl_chart_gauge.Minor_Unit          = chart_gauge_dto.Minor_Unit;
                    tbl_chart_gauge.Start_Angle         = chart_gauge_dto.Start_Angle;
                    tbl_chart_gauge.Target_Matric_Id    = chart_gauge_dto.Target_Matric.Id;
                    tbl_chart_gauge.Target_Matric_Label = chart_gauge_dto.Target_Matric_Label;

                    tbl_chart_gauge.From_Date = chart_gauge_dto.Chart_Common_Property_DTO.From_Date;
                    if (chart_gauge_dto.Chart_Common_Property_DTO.Time_Line != null)
                    {
                        tbl_chart_gauge.Time_Line = chart_gauge_dto.Chart_Common_Property_DTO.Time_Line.ToString();
                    }
                    tbl_chart_gauge.To_Date   = chart_gauge_dto.Chart_Common_Property_DTO.To_Date;
                    tbl_chart_gauge.Precision = chart_gauge_dto.Chart_Common_Property_DTO.Precision;

                    return(tbl_chart_gauge);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else
            {
                throw new Chart_Gauge_Exception(Resources.Chart_Gauge_Null_Exception);
            }
        }