예제 #1
0
        // private Record m_record;
        private Denik.Record createDataRec(Denik.Record initRecord)
        {
            //todo pridat do seznamu
            Denik.Record result = initRecord;

            try
            {
                result.Cost = MoneyConvertor.StrToMoney(edMoney.Text, MaxValue - 1);        //todo kontrola konverze
                if (result.Cost < 0 || result.Cost >= MaxValue)
                {
                    throw new Exception();
                }
            }
            catch
            {
                MessageBox.Show("Částka musí být celé číslo menší než " + (MaxValue - 1).ToString() + ".", "Chyba", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(null);
            }
            result.NoteToNumber = cbNoteToNumber.Text;
            result.Date         = edDate.Text;
            result.CustName     = cbFrom.Text;
            result.Content      = cbContent.Text;
            result.Note         = edNote.Text;
            result.Type         = Record.RecordType.Income;
            return(result);
        }
예제 #2
0
        private void insertIncomeFormHandler(object o, EventArgs ea)
        {
            Record newRecord = new Record();

            initRecord(ref newRecord, m_mainDiary);

            Denik.Record record = insertIncomeForm(newRecord);
            if (record != null)
            {
                m_mainDiary.InsertRecord(contextMenuRowIndex, record);
            }
            UpdateCurrentPage();
        }
예제 #3
0
        private bool finishOK()
        {
            Denik.Record record = createDataRec(dataRec);
            if (record == null)
            {
                return(false);
            }
            dataRec = record;

            //Settings.Settings.SettingsHolder.addHint("IncomeNote", dataRec.NoteToNumber);
            Settings.Settings.SettingsHolder.addHint("IncomeName", dataRec.CustName);
            Settings.Settings.SettingsHolder.addHint("IncomeFor", dataRec.Content);

            return(true);
        }
예제 #4
0
        private void asTemplate_Click(object sender, EventArgs e)
        {
            InputBox inputBox = new InputBox();

            inputBox.ShowDialog();
            if (inputBox.Result != DialogResult.OK)
            {
                return;
            }
            Denik.Record template = createDataRec(dataRec);
            if (template != null)
            {
                Settings.Settings.SettingsHolder.addTemplate(inputBox.InputText, template);
            }
            Settings.Settings.Store();
            m_parentMain.LoadSettings();
        }
예제 #5
0
파일: Settings.cs 프로젝트: buldasek/denik
 public void addTemplate(string name, Denik.Record template)
 {
     m_incomeTemplatesHolder.m_templates.Add(new IncomeTemplatesHolder.Template(name, template));
 }
예제 #6
0
파일: Settings.cs 프로젝트: buldasek/denik
 public Template(string name, Denik.Record values)
 {
     m_name   = name;
     m_values = values;
 }