public KanbanSettingGetResponse Execute(KanbanSettingGetRequest request) { KanbanSettingGetResponse settingGetResponse = new KanbanSettingGetResponse(); KanbanSettingInfo kanbanSetting = ServiceHelper.LoadService <ISettingService>().GetKanbanSetting(1); settingGetResponse.KanbanSetting = kanbanSetting.ToModel(); return(settingGetResponse); }
public KanbanReportGetResponse Execute(KanbanReportGetRequest request) { KanbanReportGetResponse reportGetResponse = new KanbanReportGetResponse(); KanbanSettingInfo kanbanSetting = ServiceHelper.LoadService <ISettingService>().GetKanbanSetting(1); reportGetResponse.KanbanSetting = kanbanSetting.ToModel(); reportGetResponse.AlarmReportData = ServiceHelper.LoadService <IReportService>().GetAlarmReport(kanbanSetting.AlarmReportTimeSection); reportGetResponse.ProductionReportData = ServiceHelper.LoadService <IReportService>().GetProductionReport(kanbanSetting.ProductionReportTimeSection); reportGetResponse.ExcellentRateReportData = ServiceHelper.LoadService <IReportService>().GetExcellentRateReport(kanbanSetting.ExcellentRateReportTimeSection); return(reportGetResponse); }
public KanbanSettingSaveResponse Execute(KanbanSettingSaveRequest request) { KanbanSettingSaveResponse settingSaveResponse = new KanbanSettingSaveResponse(); KanbanSettingInfo kanbanSetting = ServiceHelper.LoadService <ISettingService>().GetKanbanSetting(request.KanbanSettingId); kanbanSetting.ExcellentRateReportTimeSection = request.ExcellentRateReportTimeSection; kanbanSetting.AlarmReportTimeSection = request.AlarmReportTimeSection; kanbanSetting.ProductionReportTimeSection = request.ProductionReportTimeSection; kanbanSetting.RefreshInterval = request.RefreshInterval; ServiceHelper.LoadService <ISettingService>().SaveKanbanSetting(kanbanSetting); return(settingSaveResponse); }
public KanbanSettingInfo GetKanbanSetting(int kanbanSettingId) { DataTable tb = getKanbanSetting(kanbanSettingId); if (tb != null && tb.Rows.Count > 0) { KanbanSettingInfo info = new KanbanSettingInfo(); info.KanbanSettingId = int.Parse(tb.Rows[0][0].ToString()); info.ProductionReportTimeSection = (TimeSectionType)Enum.Parse(typeof(TimeSectionType), tb.Rows[0][1].ToString()); info.ExcellentRateReportTimeSection = (TimeSectionType)Enum.Parse(typeof(TimeSectionType), tb.Rows[0][2].ToString()); info.AlarmReportTimeSection = (TimeSectionType)Enum.Parse(typeof(TimeSectionType), tb.Rows[0][3].ToString()); info.DateFormat = tb.Rows[0][4].ToString(); info.TimeFormat = tb.Rows[0][5].ToString(); info.RefreshInterval = int.Parse(tb.Rows[0][6].ToString()); return(info); } else { throw new Exception("执行 getKanbanSetting 查询到空值"); } }
public void SaveKanbanSetting(KanbanSettingInfo kanbanSettingInfo) { Database equipDB = dataProvider.EQUIPDataBase; string sql = string.Format( @"update kanban_settings t set t.ProductionReportTimeSection = {1}, t.ExcellentRateReportTimeSection = {2}, t.AlarmReportTimeSection = {3}, t.DateFormat = '{4}', t.TimeFormat = '{5}', t.RefreshInterval = {6} where t.KanbanSettingId = '{0}'" , kanbanSettingInfo.KanbanSettingId , (int)kanbanSettingInfo.ProductionReportTimeSection , (int)kanbanSettingInfo.ExcellentRateReportTimeSection , (int)kanbanSettingInfo.AlarmReportTimeSection , kanbanSettingInfo.DateFormat , kanbanSettingInfo.TimeFormat , kanbanSettingInfo.RefreshInterval ); equipDB.ExecuteNonQuery(CommandType.Text, sql); }
public void SaveKanbanSetting(KanbanSettingInfo kanbanSettingInfo) { this.DataContext.SaveChanges(); }
public static KanbanSettingModel ToModel(this KanbanSettingInfo entity) { return(Mapper.Map <KanbanSettingInfo, KanbanSettingModel>(entity)); }