public JournalForm() { this.components = null; base(); this.InitializeComponent(); DateTime now = DateTime.Now; JournalForm._date = now.Date; this._journal = new JournalBll(); JournalForm.mode = Mode.Null; }
private void btnSave_Click(object sender, EventArgs e) { try { if (this._journal.checkBalance()) { this._journal.saveJournal(); this._journal = new JournalBll(); JournalForm._savedIndex = this._journal.getJournal().Count - 1; MessageBox.Show("تم ترحيل القيود"); } else { MessageBox.Show("القيد غير موزون، لايمكن الحفظ"); } } catch (Exception exception) { MessageBox.Show(string.Concat(" خطأ في اتصال قاعدة البيانات ", exception.Message), "DB Error"); } }
private void btnSearch_Click(object sender, EventArgs e) { int num; this.tvResult.Nodes.Clear(); DateTime @value = this.dtFrom.Value; DateTime date = @value.Date; @value = this.dtTo.Value; DateTime dateTime = @value.Date; this._Journal = new JournalBll(); this._Journal.getJournalFromTo(date, dateTime); this.JTable = this._Journal.getJournal(); if (this.rbDay.Checked) { popupBrowse _popupBrowse1 = new popupBrowse(); this._dayShow = true; _popupBrowse1.dates = this.JTable.Select <DailyJournalRow, DateTime>(new Func <DailyJournalRow, DateTime>((d) => { DateTime dateDT = d.Date_DT; return(dateDT.Date); } )).Distinct <DateTime>(); this.tvResult.Nodes.Add("-1", "كل"); this.tvResult.Nodes["-1"].Tag = new KeyValuePair <TagType, string>(3, string.Concat(date.ToShortDateString(), "-", dateTime.ToShortDateString())); Func <DailyJournalRow, bool> func1 = null; popupBrowse _popupBrowse2 = new popupBrowse(); _popupBrowse2.CS$ < > 8__localse = _popupBrowse1; _popupBrowse2.x = 0; while (_popupBrowse2.x < _popupBrowse1.dates.Count <DateTime>()) { &_popupBrowse2.x.ToString().Add(@value = _popupBrowse1.dates.ElementAt <DateTime>(_popupBrowse2.x), @value.ToShortDateString(), ""); IEnumerable <int> nums = func1 = new Func <DailyJournalRow, bool>(_popupBrowse2.< btnSearch_Click > b__1).Where <DailyJournalRow>(func1).Select <DailyJournalRow, int>(new Func <DailyJournalRow, int>((s) => s.code)).Distinct <int>(); @value = _popupBrowse1.dates.ElementAt <DateTime>(_popupBrowse2.x).Tag = new KeyValuePair <TagType, string>(@value = @value.Date, @value.ToShortDateString()); for (int i = 0; i < nums.Count <int>(); i++) { " | ".Add(string.Concat(@value = _popupBrowse1.dates.ElementAt <DateTime>(_popupBrowse2.x), @value = @value.Date, @value.ToShortDateString())); 4.Tag = new KeyValuePair <TagType, string>(num = nums.ElementAt <int>(i), num.ToString()); } _popupBrowse2.x = _popupBrowse2.x + 1; } } if (this.rbMonth.Checked) { popupBrowse _popupBrowse3 = new popupBrowse(); this._dayShow = false; _popupBrowse3.yearResult = this.JTable.Select <DailyJournalRow, int>(new Func <DailyJournalRow, int>((year) => { DateTime dateDT = year.Date_DT; return(dateDT.Year); } )).Distinct <int>(); Func <DailyJournalRow, bool> func2 = null; popupBrowse _popupBrowse4 = new popupBrowse(); _popupBrowse4.CS$ < > 8__locals13 = _popupBrowse3; _popupBrowse4.y = 0; while (_popupBrowse4.y < _popupBrowse3.yearResult.Count <int>()) { popupBrowse _popupBrowse5 = new popupBrowse(); &_popupBrowse4.y.ToString().Add(num = _popupBrowse3.yearResult.ElementAt <int>(_popupBrowse4.y), num.ToString()); 2.Tag = new KeyValuePair <TagType, string>(num = _popupBrowse3.yearResult.ElementAt <int>(_popupBrowse4.y), num.ToString()); func2.monthResult = func2 = new Func <DailyJournalRow, bool>(_popupBrowse4.< btnSearch_Click > b__4).Where <DailyJournalRow>(func2).Select <DailyJournalRow, int>(new Func <DailyJournalRow, int>((month) => { DateTime dateDT = month.Date_DT; return(dateDT.Month); } )).Distinct <int>(); Func <DailyJournalRow, bool> func3 = null; popupBrowse _popupBrowse6 = new popupBrowse(); _popupBrowse6.CS$ < > 8__locals18 = _popupBrowse5; _popupBrowse6.CS$ < > 8__locals16 = _popupBrowse4; _popupBrowse6.CS$ < > 8__locals13 = _popupBrowse3; _popupBrowse6.m = 0; while (_popupBrowse6.m < _popupBrowse5.monthResult.Count <int>()) { this.tvResult.Nodes[_popupBrowse4.y.ToString()].Nodes.Add(_popupBrowse6.m.ToString(), this.months[_popupBrowse5.monthResult.ElementAt <int>(_popupBrowse6.m)]); 1.Tag = new KeyValuePair <TagType, string>(num = _popupBrowse5.monthResult.ElementAt <int>(_popupBrowse6.m), num.ToString()); IEnumerable <DateTime> dateTimes = func3 = new Func <DailyJournalRow, bool>(_popupBrowse6.< btnSearch_Click > b__6).Where <DailyJournalRow>(func3).Select <DailyJournalRow, DateTime>(new Func <DailyJournalRow, DateTime>((day) => { DateTime dateDT = day.Date_DT; return(dateDT.Date); } )).Distinct <DateTime>(); for (int j = 0; j < dateTimes.Count <DateTime>(); j++) { j.ToString().Add(@value = dateTimes.ElementAt <DateTime>(j), @value.ToShortDateString()); 0.Tag = new KeyValuePair <TagType, string>(@value = dateTimes.ElementAt <DateTime>(j), @value.ToShortDateString()); } _popupBrowse6.m = _popupBrowse6.m + 1; } _popupBrowse4.y = _popupBrowse4.y + 1; } } }