private void bniXMLImport_Click(object sender, EventArgs e)
 {
     if (!SaveData())
     {
         return;
     }
     var form = MyMainForm.ShowFormDialog(typeof(Form_UntaxedMinimumImport)) as Form_UntaxedMinimumImport;
 }
Exemple #2
0
        private void cmShowErrors_Click(object sender, EventArgs e)
        {
            if (ErrorList == null || ErrorList.Count == 0)
            {
                MyMainForm.ShowInfo("Kļūdu saraksts ir tukšs.");
                return;
            }
            var fm = MyMainForm.ShowFormDialog(typeof(Form_ImportErrors)) as Form_ImportErrors;

            if (fm == null)
            {
                return;
            }
            fm.SetErrorList(ErrorList);
        }
Exemple #3
0
        private void DoIt(bool doreport = true)
        {
            string rt = Check();

            if (rt != "OK")
            {
                MyMainForm.ShowWarning(rt);
                return;
            }

            SaveParams();

            ROps2aTableAdapter ad = MyData.GetKlonsRepAdapter("ROps2a") as ROps2aTableAdapter;

            if (ad == null)
            {
                return;
            }

            try
            {
                if (cbCharCount.Text == "*")
                {
                    ad.FillBy_apgr_11(MyData.DataSetKlonsRep.ROps2a, startDate, endDate, ac);
                }
                else
                {
                    ad.FillBy_apgr_21(MyData.DataSetKlonsRep.ROps2a, startDate, endDate, ac, int.Parse(cbCharCount.Text));
                }
            }
            catch (ConstraintException e)
            {
                Exception e1 = ExceptionHelper.TranslateException(e, MyData.DataSetKlonsRep.ROps2a);
                Form_Error.ShowException(MyMainForm, e1);
                return;
            }

            MyData.ReportHelper.PrepareRops2a();

            if (doreport)
            {
                ReportViewerData rd = new ReportViewerData();
                rd.FileName            = "Report_Apgr_Bil";
                rd.Sources["DataSet1"] = MyData.DataSetKlonsRep.ROps2a;
                rd.AddReportParameters(
                    new string[]
                {
                    "RSD", startDateStr,
                    "RED", endDateStr,
                    "RACX", cbAC.Text,
                    "RACNM", lbACName.Text,
                    "CompanyName", MyData.Params.CompNameX,
                    "RCURRENCY", ""
                });

                MyMainForm.ShowReport(rd);
            }
            else
            {
                var fm = MyMainForm.ShowFormDialog(typeof(Form_Apgr1)) as Form_Apgr1;
                if (fm == null)
                {
                    return;
                }
                fm.Show();
                fm.LoadParams();
            }
        }