Пример #1
0
        private void AddAnalyse_Click_1(object sender, EventArgs e)
        {
            AnalyseModel addmodel  = new AnalyseModel();
            DateModel    datemodel = new DateModel();

            datemodel.Day   = Program.Current_Date.Date;
            datemodel.Time += Program.Current_Date.TimeOfDay;

            addmodel.Date_Id = date.Add(datemodel);
            try
            {
                int selected = ListView.SelectedIndices[0];
                addmodel.Type_Id   = Analyse_Type.SelectedIndex + 1;
                addmodel.Client_Id = long.Parse(ListView.Items[selected].SubItems[0].Text);
                addmodel.Result    = long.Parse(ResultText.Text);
                addmodel.Coment    = Coment.Text;
                analyse.Add(addmodel);
                Coment.Clear();
                ResultText.Clear();
                MessageBox.Show("Данные внесены");
            }
            catch
            {
                MessageBox.Show("Некоторые поля не выбраны");
            }
        }