private void barbtn_SignReadBook_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { UC_ReadSignEdit content = new UC_ReadSignEdit(); tabHelper.AddorShowTabPage(barbtn_SignReadBook.Caption, content); GParam.Create().Mediator.AddActor(typeof(UC_ReadSignEdit).Name, content); }
private void barButtonItem3_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { UC_GYMSignScan content = new UC_GYMSignScan(); tabHelper.AddorShowTabPage(barButtonItem3.Caption, content); GParam.Create().Mediator.AddActor(typeof(UC_GYMSignScan).Name, content); }
private void barBtn_SalaryPlan_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { UC_SalaryPlan content = new UC_SalaryPlan(); tabHelper.AddorShowTabPage(barBtn_SalaryPlan.Caption, content); GParam.Create().Mediator.AddActor(content.GetType().Name, content); }
private void barBtn_UC_ExportBusinesStripExcel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { UC_ExportBusinesStripExcel content = new UC_ExportBusinesStripExcel(); tabHelper.AddorShowTabPage(barBtn_UC_ExportBusinesStripExcel.Caption, content); GParam.Create().Mediator.AddActor(content.GetType().Name, content); }
private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { UC_DailyPlanSignCompare content = new UC_DailyPlanSignCompare(); tabHelper.AddorShowTabPage(this.barBtn_DailyPlanSignCompare.Caption, content); GParam.Create().Mediator.AddActor(typeof(UC_DailyPlanSignCompare).Name, content); }
private void barBtn_SpecialDailyScheduler_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { UC_SpecialDailyCalender content = new UC_SpecialDailyCalender(); tabHelper.AddorShowTabPage(barBtn_SpecialDailyScheduler.Caption, content); GParam.Create().Mediator.AddActor(typeof(UC_SpecialDailyCalender).Name, content); }
private void batBtn_weed_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { UC_BudgetWeed content = new UC_BudgetWeed(); tabHelper.AddorShowTabPage(batBtn_weed.Caption, content); GParam.Create().Mediator.AddActor(typeof(UC_BudgetWeed).Name, content); }
public bool InsertEntriesWithDateDelete(IList <TB_DailyPlanSign> list, DateTime signDate) { bool result = true; using (var db = this.dbFactory.OpenDefalutDataBase()) { try { db.TransactionEnabled = true; db.Remove <TB_DailyPlanSignSet>(TB_DailyPlanSignSet.Date.Equal(FormatDate(signDate))); foreach (TB_DailyPlanSign item in list) { item.Date = FormatDate(signDate); db.Add(item); } db.Transaction.Commit(); } catch (Exception ex) { db.Transaction.Rollback(); result = false; GParam.Create().SystemLogger.Error("InsertEntriesWithDateDelete", ex); } } return(result); }
private void btn_Sure_Click(object sender, EventArgs e) { Validator validator = onValidateInputValue(); if (validator.IsValidate == false) { MessageBoxHelper.ShowInputErrorDialog(validator.ErrorMessage); return; } if (controller.Entry == null) { controller.LoadEntry(); onExtractInputValue(); MessageBoxHelper.ShowCreateStateDialog(controller.InsertEntry()); } else { onExtractInputValue(); MessageBoxHelper.ShowUpdateStateDialog(controller.UpdateEntryByID()); } controller.ReleaseEntry(); onInitialUI(); //同步更新阅读打卡界面,主要用于刷新书籍下拉菜单 GParam.Create().Mediator.NotifyUpdateBookSign(); }
private void BarBtn_DailyPlanUpdate_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { UC_DailyPlanSignUpdate content = new UC_DailyPlanSignUpdate(); tabHelper.AddorShowTabPage(BarBtn_DailyPlanUpdate.Caption, content); GParam.Create().Mediator.AddActor(typeof(UC_DailyPlanSignUpdate).Name, content); }
public bool InsertWithDeleteOldRecord(object baseEntryPK, IList <TB_GYMAPPARATUS> Entries) { bool result = true; using (var db = this.dbFactory.OpenDefalutDataBase()) { try { db.TransactionEnabled = true; db.Remove <TB_GYMAPPARATUSSet>(TB_GYMAPPARATUSSet.BaseID.Equal(baseEntryPK)); foreach (var item in Entries) { item.BaseID = long.Parse(baseEntryPK.ToString()); db.Add(item); } db.Transaction.Commit(); } catch (Exception ex) { result = false; db.Transaction.Rollback(); GParam.Create().SystemLogger.Debug("DeleteEntriesByBaseID", ex); } } return(result); }
private void barBtn_VacationTravel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { UC_SpecialDailyEdit content = new UC_SpecialDailyEdit(EnumSpecialDailyType.VacationTravel); tabHelper.AddorShowTabPage(barBtn_VacationTravel.Caption, content); GParam.Create().Mediator.AddActor(typeof(UC_SpecialDailyEdit).Name, content); }
public void onInitialUI() { if (adapter != null) { adapter.NotifyClearTable(); adapter.NotifyDestoryTable(); } adapter.Initial(controller.TravleAllEntities(), builder); adapter.NotifyfreshDataTable(); gridHelper.GridControl.DataSource = adapter.ResultTable; gridHelper.SetAllColumnEditable(false); gridHelper.setColunmsVisual(false, builder.ID, builder.Actuality, builder.WeedDate, builder.Op_Detail, builder.CatalogID, builder.DifferentReason); gridHelper.SetCellResposity(builder.Op_Edit, Repo_HLE_Edit); gridHelper.SetCellResposity(builder.Op_Delete, Repo_HLE_Delete); this.dateE_Sign.DateTime = DateTime.Now.Date; this.cmb_Catalog.Properties.Items.Clear(); foreach (var item in new BudgetCatalogManageController().TravleAllEntities()) { this.cmb_Catalog.Properties.Items.Add(item); } tv_Statistic.Text = new BudgetStatistician().Statistic(GParam.Create()).toDisplayString(); }
private void btn_Sure_Click(object sender, EventArgs e) { Validator valitor = onValidateInputValue(); if (valitor.IsValidate == false) { MessageBoxHelper.ShowInputErrorDialog(valitor.ErrorMessage); return; } gymbaseController.LoadEntry(); onExtractInputValue(); object baseEntryPK = null; if (gymbaseController.InsertEntry(out baseEntryPK)) { bool result = gymAppController.InsertWithDeleteOldRecord(baseEntryPK, appAdaptor.DataList); if (result) { GParam.Create().Mediator.NotifyUpdateGYMSign(); } MessageBoxHelper.ShowCreateStateDialog(result); } else { MessageBoxHelper.ShowCreateStateDialog(false); } }
public bool RevokeReadingState(int planID) { bool result = true; using (var db = this.dbFactory.OpenDefalutDataBase()) { try { TB_BookReadPlan tempPlan = db.GetEntity <TB_BookReadPlan>(TB_BookReadPlanSet.SelectAll().Where(TB_BookReadPlanSet.ID.Equal(planID))); if (tempPlan.State.Equals(EnumBookPlanState.Reading)) { tempPlan.State = EnumBookPlanState.ToRead; tempPlan.EndDate = ""; tempPlan.WhereExpression = onBlindIDWhere(tempPlan); db.Update(tempPlan); } } catch (Exception ex) { result = false; GParam.Create().SystemLogger.Error("RevokeReadState", ex); } } return(result); }
private void btn_Name_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { controller.LoadEntry(); string message = ""; if (onValidateInputValue(out message) == false) { MessageBoxHelper.ShowInputErrorDialog(message); controller.ReleaseEntry(); return; } onExtractInputValue(); if (controller.CurrentID == 0) { MessageBoxHelper.ShowCreateStateDialog(controller.InsertEntry()); } else { MessageBoxHelper.ShowUpdateStateDialog(controller.UpdateEntryByID()); } onInitialUI(); GParam.Create().Mediator.NotifyUpdateReadPlan(); }
private void btn_Sure_Click(object sender, EventArgs e) { Validator validator = onValidateInputValue(); if (validator.IsValidate == false) { MessageBoxHelper.ShowInputErrorDialog(validator.ErrorMessage); return; } controller.LoadEntry(); onExtractInputValue(); if (controller.InsertEntry()) { string state = rg_state.SelectedIndex == 0 ? EnumBookPlanState.Reading : EnumBookPlanState.Read; MessageBoxHelper.ShowCreateStateDialog(new ReadPlanManageController().UpdatePlanState(controller.Entry.ReadPlanID, state, calendar_Date.DateTime.Date)); onInitialUI(); //如果已经读完,则需要通知更新阅读清单界面 if (state.Equals(EnumBookPlanState.Read)) { GParam.Create().Mediator.NotifyUpdateReadPlan(); } } else { MessageBoxHelper.ShowCreateStateDialog(false); } }
private void btn_Sure_Click(object sender, EventArgs e) { if (controller.Entry == null) { controller.LoadEntry(); onExtractInputValue(); if (controller.InsertEntry()) { onInitialUI(); GParam.Create().Mediator.NotifySpecialDailyCalender(); } else { MessageBoxHelper.ShowCreateStateDialog(true); } } else { onExtractInputValue(); if (controller.UpdateEntryByID()) { onInitialUI(); GParam.Create().Mediator.NotifySpecialDailyCalender(); } else { MessageBoxHelper.ShowUpdateStateDialog(false); } } }
private void UC_GYMCompareItem_Load(object sender, EventArgs e) { chartHelper = new ChartControlHelper(this.chartControl1); dataBuilder = new SingleDataValueSeriesBuilder(); statistician = new GYMAPPARATUSStatistician(GParam.Create()); startDate = DateTime.Now.Date; endDate = DateTime.Now.Date; }
private void Btn_Sure_Click(object sender, EventArgs e) { if (Controller.InsertEntriesWithDateDelete(builder.ExtractEntries(this.gridControl_Sign.DataSource as DataTable), this.dateEdit1.DateTime.Date)) { onInitialUI(); GParam.Create().Mediator.NotifyDailyPlanSignScan(); } else { MessageBoxHelper.ShowCreateStateDialog(false); } }
public void onCreateComponet() { statistician = new DailyPlanSignStatistician(GParam.Create()); chartHelper_Month = new ChartControlHelper(chartControl_Month); dataBuilder_Month = new SingleDataValueSeriesBuilder(); dataBuilder_Month.CreateSeries("Result", DevExpress.XtraCharts.ViewType.Bar); dataBuilder_Month.StyleDesigner.SetPieLengedFormat("{A}"); dataBuilder_Month.StyleDesigner.SetBarSeriesEachColor(true); chartHelper_Year = new ChartControlHelper(chartControl_Year); dataBuilder_Year = new MulitSingleDataValueSeriesBuilder(); dataBuilder_Year.CreateSeriesDict(DevExpress.XtraCharts.ViewType.Line); }
private void Repo_HLE_Delete_Click(object sender, EventArgs e) { int currentID = this.gridHelper.getFocuseRowCellValue_Int(builder.ID); if (controller.DeleteEntryByID <TB_SpecialDailySet>(currentID)) { onInitialUI(); GParam.Create().Mediator.NotifySpecialDailyCalender(); } else { MessageBoxHelper.ShowUpdateStateDialog(false); } }
public IList <TB_GYMAPPARATUS> QueryEntriesByBaseID(object baseID) { List <TB_GYMAPPARATUS> result = new List <TB_GYMAPPARATUS>(); using (var db = this.dbFactory.OpenDefalutDataBase()) { try { result.AddRange(db.GetEntities <TB_GYMAPPARATUS>(TB_GYMAPPARATUSSet.SelectAll().Where(TB_GYMAPPARATUSSet.BaseID.Equal(baseID)))); } catch (Exception ex) { GParam.Create().SystemLogger.Debug("QueryEntriesByBaseID", ex); } } return(result); }
public DataTable CreateTable() { if (ResultTable != null) { ResultTable.Clear(); ResultTable.Columns.Clear(); } ResultTable = new DataTable(); IDictionary <long, string> CatalogIDMaps = new Dictionary <long, string>(); ResultTable.Columns.Add(new DataColumn("日期", typeof(string))); foreach (var item in new DailyPlanCatalogManageController().TravleAllEntities()) { CatalogIDMaps.Add(item.ID, item.Name); ResultTable.Columns.Add(item.Name, typeof(object)); } using (var db = GParam.Create().OpenDefalutDataBase()) { DateTime currentDate = StartDate; while (currentDate.CompareTo(EndDate) <= 0) { DataRow tempRow = ResultTable.NewRow(); IList <TB_DailyPlanSign> SignRecord = db.GetEntities <TB_DailyPlanSign>(TB_DailyPlanSignSet.SelectAll().Where(TB_DailyPlanSignSet.Date.Equal(currentDate.ToString("yyyy-MM-dd")))); tempRow["日期"] = currentDate.ToString("yyyy年MM月dd日"); if (SignRecord != null && SignRecord.Count != 0) { foreach (var item in SignRecord) { if (Boolean.Parse(item.IsSign)) { tempRow[CatalogIDMaps[item.CatalogID]] = item; } } } currentDate = currentDate.AddDays(1); ResultTable.Rows.Add(tempRow); } } return(ResultTable); }
public void onCreateComponet() { statistician = new DailyPlanSignStatistician(GParam.Create()); chartHelper_Precent = new ChartControlHelper(chart_Present); dataBuilder_Precent = new SingleDataValueSeriesBuilder(); dataBuilder_Precent.CreateSeries("Precent", DevExpress.XtraCharts.ViewType.Pie); dataBuilder_Precent.StyleDesigner.SetPieLengedFormat("{A} - {V}天数"); chartHelper_State = new ChartControlHelper(chart_State); dataBuilder_State = new SingleDataValueSeriesBuilder(); dataBuilder_State.CreateSeries("State", DevExpress.XtraCharts.ViewType.Bar); dataBuilder_State.StyleDesigner.SetBarSeriesEachColor(true); dataBuilder_State.StyleDesigner.SetSeriesLengedOption(true, "{A}"); controller = new DailyPlanSignManageController(); builder = new TB_DailyPlanSignBuilder(); adapter = new TB_DailyPlanSignAdapter(); gridHelper_Record = new GridControlHelper(this.gridView_record, this.gridControl_record); }
private void Repos_HLE_Delete_Click(object sender, EventArgs e) { int targetID = (int)adapter[gridView_BookCatalog.FocusedRowHandle].ID; if (controller.CheckBookCatalogHaveReference(targetID)) { MessageBoxHelper.ShowDialog("提示", "当前类型已经在[阅读记录]中使用,请先删除关联记录后重试"); } else { if (controller.DeleteEntryByID <TB_BookCatalogSet>(targetID)) { onInitialUI(); GParam.Create().Mediator.NotifyUpdateReadPlan(); } else { MessageBoxHelper.ShowDeleteStateDialog(false); } } }
public void onInitialUI() { dateEdit_Start.DateTime = startDate; dateEdit_End.DateTime = endDate; //有氧训练图 baseDatabuilder.ClearDataSeries(); foreach (var item in controller.TraveleEntriesByDateRange(startDate, endDate)) { baseDatabuilder.AddData(DateTime.Parse(item.Date), item.Calorie); } baseDatabuilder.StyleDesigner.SetLineSeriesStyle(DevExpress.XtraCharts.DashStyle.Solid, 5, Color.LightBlue); baseDatabuilder.StyleDesigner.SetLineSeriesMarkerStyle(DevExpress.XtraCharts.MarkerKind.Circle, 6, Color.LightGreen); baseChartHelper.ReplaceSeries(baseDatabuilder.DataSeries); baseChartHelper.SetYaxisRange(baseDatabuilder.MinValue, baseDatabuilder.MaxValue, 10); //器械训练图 GYMAPPARATUSStatistician statistician = new GYMAPPARATUSStatistician(GParam.Create()); foreach (var item in new GYMCatalogManageController().TravleAllEntities()) { SingleDataValueSeriesBuilder tempBuilder = appDataBuilder.First(x => x.DataSeries.Name.Equals(item.Name)); tempBuilder.ClearDataSeries(); foreach (DataRow row in statistician.StatisticDateRangeTypeTotal(item.ID, startDate, endDate).Rows) { tempBuilder.AddData(DateTime.Parse(row[0].ToString()), double.Parse(row[1].ToString())); } appChartHelper.ReplaceSeries(tempBuilder.DataSeries); } //锻炼日期数 dateCountDataBuilder.ClearDataSeries(); int[] countResult = statistician.StatisticGYMRecordCount(startDate, endDate); tv_StatisiticDay.Text = "" + countResult[0]; tv_ExericeDays.Text = "" + countResult[1]; dateCountDataBuilder.AddData("锻炼天数", countResult[1]); dateCountDataBuilder.AddData("未锻炼天数", countResult[2]); dateChartHelper.ReplaceSeries(dateCountDataBuilder.DataSeries); //累计训练量 dateSumDataBuilder.ClearDataSeries(); dateSumDataBuilder.AddDataFromTable(statistician.StatisticGYMDateRangeCatalogSum(startDate, endDate), 0, 1); sumChartHelper.ReplaceSeries(dateSumDataBuilder.DataSeries); }
public bool Export() { bool result = false; ExcelHelper helper = new ExcelHelper(FilePath); if (helper.StartEdit(0) == false) { GParam.Create().WriteSystemLog(helper.ErrorMessage); return(result); } try { DataTable exportDt = new DataTable(); exportDt.Columns.Add("日期", typeof(string)); foreach (TB_DailyPlanCatalog item in CatalogItems) { DataColumn col = new DataColumn(); col.ColumnName = item.Name; col.Caption = item.Name; exportDt.Columns.Add(col); } while (StartDate.CompareTo(EndDate) <= 0) { DataRow temprow = exportDt.NewRow(); temprow[0] = StartDate.ToString("yyyy-MM-dd"); exportDt.Rows.Add(temprow); StartDate = StartDate.AddDays(1); } helper.InsertDataTable(exportDt); result = helper.Save(); } catch (Exception ex) { GParam.Create().WriteSystemLog("Export", ex); } return(result); }
public void onCreateComponet() { statistician = new ReadPlanCompareStatistician(GParam.Create()); chartHelper_ReadDays = new ChartControlHelper(this.chart_ReadDaysCount); databuilder_ReadDays = new SingleDataValueSeriesBuilder(); databuilder_ReadDays.CreateSeries("ReadDays", DevExpress.XtraCharts.ViewType.Pie); databuilder_ReadDays.StyleDesigner.SetPieLengedFormat("{A} - {V} 天"); chartHelper_Contruction = new ChartControlHelper(this.chart_ReadConstruction); databuilder_Contruction = new SingleDataValueSeriesBuilder(); databuilder_Contruction.CreateSeries("Construction", DevExpress.XtraCharts.ViewType.Bar); databuilder_Contruction.StyleDesigner.SetSeriesLengedOption(true, "{A}"); databuilder_Contruction.StyleDesigner.SetBarSeriesEachColor(true); chartHelper_State = new ChartControlHelper(this.chart_ReadPlanState); dataBuilder_State = new SingleDataValueSeriesBuilder(); dataBuilder_State.CreateSeries("ReadPlanState", DevExpress.XtraCharts.ViewType.Pie); dataBuilder_State.StyleDesigner.SetPieLengedFormat("{A} - {V} 本"); gridHelper = new GridControlHelper(this.gridView_MonthRecord, this.gridControl_MonthRecord); }
//internal DateTime ConvertToDate(string p) //{ // DateTime result = new DateTime(); // try // { // result = DateTime.Parse(p); // } // catch (Exception ex) // { // GParam.Create().SystemLogger.Debug("ConvertToDate", ex); // } // return result; //} //public bool FinishReadPlan(long currentID) //{ // bool result = true; // try // { // using (var db = this.dbFactory.OpenDefalutDataBase()) // { // TB_BookReadPlan temp = db.GetEntity<TB_BookReadPlan>(onCreateMQL_QueryEntryByID((int)currentID)); // temp.State = (long)EnumBookPlanState.Read; // db.Update(temp); // } // } // catch (Exception ex) // { // result = false; // GParam.Create().SystemLogger.Debug("FinishReadPlan", ex); // } // return result; //} public bool UpdatePlanState(long planID, string state, DateTime dateTime) { bool result = true; using (var db = this.dbFactory.OpenDefalutDataBase()) { try { TB_BookReadPlan tempPlan = db.GetEntity <TB_BookReadPlan>(TB_BookReadPlanSet.SelectAll().Where(TB_BookReadPlanSet.ID.Equal(planID))); if (tempPlan.State.Equals(EnumBookPlanState.ToRead)) { tempPlan.StartDate = FormatDate(dateTime); if (state.Equals(EnumBookPlanState.Read)) { tempPlan.EndDate = FormatDate(dateTime); } tempPlan.State = state; tempPlan.WhereExpression = onBlindIDWhere(tempPlan); db.Update(tempPlan); } else if (tempPlan.State.Equals(EnumBookPlanState.Reading)) { if (state.Equals(EnumBookPlanState.Read)) { tempPlan.EndDate = FormatDate(dateTime); tempPlan.State = state; tempPlan.WhereExpression = onBlindIDWhere(tempPlan); db.Update(tempPlan); } } } catch (Exception ex) { result = false; GParam.Create().SystemLogger.Error("UpdatePlanState", ex); } } return(result); }