Esempio n. 1
0
 private bool zaladujPrzycisk(Procedures ProcedureId, int ControlId, Events Event)
 {
     oknoGlowne                 = GetWindow();
     przycisk                   = oknoGlowne.Children["?TabKaucje"].Children.Add(ControlTypes.button);
     przycisk.Visible           = true;
     przycisk.TextRaw           = "Rozlicz";
     oknoGlowne.OnBeforeSized  += oknoProgramu_OnBeforeSized;
     przycisk.OnBeforeAccepted += przycisk_OnBeforeAccepted;
     return(true);
 }
Esempio n. 2
0
        bool CheckIfExists(String ButtonName)
        {
            if (string.IsNullOrEmpty(TraNag.TrN_DokumentObcy) || (TraNag.TrN_KntNumer == 0))
            {
                //Runtime.WindowController.UnlockThread();
                MessageBox.Show("Please enter Invoice Reference and select a Customer", "Missing Information", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                //Runtime.WindowController.LockThread();
                return(true);
            }
            else
            {
                String SQL;
                String Document;

                SQL = "SELECT cdn.numerdokumentutrn(trn_gidtyp, trn_spityp, trn_trntyp, trn_trnnumer, trn_trnrok, trn_trnseria) As DocNum, trn_gidnumer, trn_gidtyp, TrN_DokumentObcy, Knt_Akronim, Knt_Nazwa1 FROM CDN.TraNag INNER JOIN CDN.KntKarty ON Knt_GIDNumer = TrN_KntNumer" +
                      " WHERE replace(TrN_DokumentObcy,' ','') = replace('" + TraNag.TrN_DokumentObcy + "',' ','') AND Knt_GIDNumer = " + TraNag.TrN_KntNumer.ToString() +
                      " AND TrN_Stan IN (3,4,5) AND TrN_GIDNumer <> " + TraNag.TrN_GIDNumer.ToString();

                SQLCommand.CommandText = SQL;
                SQLConn.Open();
                SqlDataReader SQLQuery = SQLCommand.ExecuteReader();
                SQLQuery.Read();

                if (SQLQuery.HasRows == true)
                {
                    Document = SQLQuery.GetString(0);
                    //Runtime.WindowController.UnlockThread();
                    MessageBox.Show("The Invoice Reference has already been used for " + Environment.NewLine + Document, "Found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    //Runtime.WindowController.LockThread();
                    SQLConn.Close();
                    ClaWindow Parent = GetWindow();
                    Parent.PostEvent(Events.ReCalculate);
                    return(false);
                }
                else
                {
                    if (ButtonName == "InvoiceButton")
                    {
                        //Runtime.WindowController.UnlockThread();
                        MessageBox.Show("The Invoice Reference has not been used for this customer.", "Not Found", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        //Runtime.WindowController.LockThread();
                    }
                    SQLConn.Close();
                    ClaWindow Parent = GetWindow();
                    Parent.PostEvent(Events.ReCalculate);
                    return(true);
                }
            } // end if


            //return true;
        } // end of CheckIfExists
Esempio n. 3
0
        bool OnOpenWindow(Procedures ProcID, int ControlID, Events Event)
        {
            ClaWindow Parent = GetWindow();

            SaveButton = Parent.AllChildren["?Cli_Zapisz"];
            SaveButton.OnBeforeAccepted += new TakeEventDelegate(SaveButtonClick);
            InvRefButton                   = Parent.Children.Add(ControlTypes.button);
            InvRefButton.Bounds            = new Rectangle(330, 58, 60, 13);
            InvRefButton.Visible           = true;
            InvRefButton.TextRaw           = "Check Invoice";
            InvRefButton.ToolTipRaw        = "Check Invoice Reference";
            InvRefButton.OnBeforeAccepted += new TakeEventDelegate(MyButtonInvoiceClick);
            InvRefButton.Visible           = true;
            InvRefButton.CursorRaw         = Cursors.Hand.ToString();

            //Sheet.Visible = true; - Instrukcja powoduje błą. Mimo zakomentowania Hydra działa prawidłowo. TLS 2019-08-23

            return(true);
        } // end of OnOpenWindow
Esempio n. 4
0
        private bool JustAfterWindowOpening(Procedures ProcID, int ControlID, Events Event)
        {
            parent      = GetWindow();
            sheet       = parent.Children["?CurrentTab"];
            tab         = sheet.Children.Add(ControlTypes.tab);
            tab.Visible = true;
            tab.TextRaw = "Branże kontrahentów";

            tab2         = tab.AllChildren.Add(ControlTypes.sheet);
            tab2.Visible = true;
            tab2.Bounds  = new Rectangle(10, 20, 600, 350);

            tab3         = tab2.AllChildren.Add(ControlTypes.tab);
            tab3.Visible = true;
            tab3.TextRaw = "Wybór branży";
            tab3.Bounds  = new Rectangle(10, 40, 600, 350);

            dropcombo         = tab3.AllChildren.Add(ControlTypes.dropcombo);
            dropcombo.Visible = true;
            dropcombo.Bounds  = new Rectangle(20, 40, 500, 15);

            button         = tab3.AllChildren.Add(ControlTypes.button);
            button.Visible = true;
            button.Bounds  = new Rectangle(530, 40, 60, 15);
            button.TextRaw = "Wyszukaj";

            list         = tab3.AllChildren.Add(ControlTypes.list);
            list.Visible = true;
            list.Bounds  = new Rectangle(20, 70, 570, 290);

            //tekst = tab3.AllChildren.Add(ControlTypes.text);
            //tekst.Bounds = new Rectangle(15, 60, 800, 50);
            //tekst.Visible = true;

            //usun = tab3.AllChildren.Add(ControlTypes.button);
            //usun.Visible = true;
            //usun.Bounds = new Rectangle(70, 40, 50, 15);
            //usun.TextRaw = "Usuń";

            return(true);
        }
        private bool JustAfterWindowOpening(Procedures ProcID, int ControlID, Events Event)
        {
            parent      = GetWindow();
            sheet       = parent.Children["?CurrentTab"];
            tab         = sheet.Children.Add(ControlTypes.tab);
            tab.Visible = true;
            tab.TextRaw = "Branże kontrahentów";

            tab2         = tab.AllChildren.Add(ControlTypes.sheet);
            tab2.Visible = true;
            tab2.Bounds  = new Rectangle(10, 20, 600, 350);

            tab3         = tab2.AllChildren.Add(ControlTypes.tab);
            tab3.Visible = true;
            tab3.TextRaw = "Wybór branży";
            tab3.Bounds  = new Rectangle(10, 40, 600, 350);

            text_SLW_ID         = tab3.AllChildren.Add(ControlTypes.text);
            text_SLW_ID.Visible = false;
            text_SLW_ID.Bounds  = new Rectangle(20, 40, 40, 15);

            text_ElBranOpisID         = tab3.AllChildren.Add(ControlTypes.text);
            text_ElBranOpisID.Visible = false;
            text_ElBranOpisID.Bounds  = new Rectangle(70, 40, 40, 15);

            item         = tab3.AllChildren.Add(ControlTypes.stringcontrol);
            item.Visible = true;
            item.Bounds  = new Rectangle(20, 40, 45, 15);
            item.TextRaw = " Branża: ";

            text_opis             = tab3.AllChildren.Add(ControlTypes.text);
            text_opis.Visible     = true;
            text_opis.Bounds      = new Rectangle(70, 40, 530, 15);
            text_opis.ReadOnlyRaw = "1";

            /*button_save = tab3.AllChildren.Add(ControlTypes.button);
             * button_save.Visible = true;
             * button_save.Bounds = new Rectangle(520, 40, 80, 15);
             * button_save.TextRaw = "Zapisz branże";
             *
             * button_add = tab3.AllChildren.Add(ControlTypes.button);
             * button_add.Visible = true;
             * button_add.Bounds = new Rectangle(520, 60, 40, 15);
             * button_add.TextRaw = "Dodaj";
             *
             * button_remove = tab3.AllChildren.Add(ControlTypes.button);
             * button_remove.Visible = true;
             * button_remove.Bounds = new Rectangle(560, 60, 40, 15);
             * button_remove.TextRaw = "Usuń";*/

            item         = tab3.AllChildren.Add(ControlTypes.stringcontrol);
            item.Visible = true;
            item.Bounds  = new Rectangle(20, 60, 45, 15);
            item.TextRaw = " Filtr: ";

            dropcombo         = tab3.AllChildren.Add(ControlTypes.dropcombo);
            dropcombo.Visible = true;
            dropcombo.Bounds  = new Rectangle(70, 60, 370, 15);

            button_search         = tab3.AllChildren.Add(ControlTypes.button);
            button_search.Visible = true;
            button_search.Bounds  = new Rectangle(450, 60, 60, 15);
            button_search.TextRaw = "Wyszukaj";

            button_load         = tab3.AllChildren.Add(ControlTypes.button);
            button_load.Visible = true;
            button_load.Bounds  = new Rectangle(520, 60, 80, 15);
            button_load.TextRaw = "Wyczyść filtr";

            list         = tab3.AllChildren.Add(ControlTypes.list);
            list.Visible = true;
            list.Bounds  = new Rectangle(20, 80, 580, 280);

            ListFromRaw(null);
            list.OnAfterAccepted += List_OnAfterAccepted;

            return(true);
        }
Esempio n. 6
0
        internal bool OnOpenWindow(Procedures ProcID, int ControlID, Events Event)
        {
            // Func<Registy, bool> predicate = null;
            bool isModimmole = this.GetFilterSchema(Runtime.ConfigurationDictionary.IdCentrumWlasciwego);

            this.ComboSchematOrg = base.GetWindow().AllChildren["?sEkr_Schemat"];
            this.ComboSchematOrg.OnAfterAccepted += new TakeEventDelegate(this.ComboSchematOrg_OnAfterAccepted);
            this.GetAccountingSchema(TraNag.TrN_GIDTyp);
            this.ComboSchemat = this.ComboSchematOrg.Parent.Children.Add(ControlTypes.droplist);

            if (isModimmole)
            {
                this.ComboSchemat.FromRaw = "*<indefinite>|" + (from s in this.ListaSchematow
                                                                where s.StartsWith("02")
                                                                select s).ToString <string>("|");
            }
            else
            {
                this.ComboSchemat.FromRaw = "*<indefinite>|" + (from s in this.ListaSchematow
                                                                where !s.StartsWith("02")
                                                                select s).ToString <string>("|");
            }
            this.ComboSchemat.OnAfterAccepted += new TakeEventDelegate(this.ComboSchemat_OnAfterAccepted);
            this.ComboSchemat.VScrollRaw       = "1";
            this.ComboSchemat.DropRaw          = "6";
            this.ComboSchematOrg.Visible       = TraNag.TrN_Zaksiegowano != 0;
            this.ComboSchemat.Enabled          = TraNag.TrN_Zaksiegowano == 0;
            this.ComboSchemat.Visible          = TraNag.TrN_Zaksiegowano == 0;
            if (this.ComboSchematOrg.SelectedRaw == "1")
            {
                this.ComboSchemat.SelectedRaw = "1";
            }
            else if (Convert.ToInt32(this.ComboSchematOrg.SelectedRaw) > 0)
            {
                string item = this.ListaSchematow[Convert.ToInt32(this.ComboSchematOrg.SelectedRaw) - 2].Trim();
                this.ComboSchemat.SelectedRaw = (this.ComboSchemat.FromRaw.Split(new char[] { '|' }).ToList <string>().IndexOf(item) + 1).ToString();
            }
            else
            {
                this.ComboSchemat.SelectedRaw = "1";
            }

            if (this.GetRegisterType(TraNag.TrN_GIDTyp) != RegisterType.Brak)
            {
                this.ComboRejestrOrg = base.GetWindow().AllChildren["?TrN:VatRejestr"];
                this.GetRegisterVAT(this.GetRegisterType(TraNag.TrN_GIDTyp));
                this.ComboRejestr                  = this.ComboRejestrOrg.Parent.Children.Add(ControlTypes.droplist);
                this.ComboRejestr.FormatRaw        = this.ComboRejestrOrg.FormatRaw;
                this.ComboRejestr.VScrollRaw       = "1";
                this.ComboRejestr.DropWidthRaw     = this.ComboRejestrOrg.DropWidthRaw;
                this.ComboRejestr.DropRaw          = "6";
                this.ComboRejestr.Visible          = true;
                this.ComboRejestr.OnAfterAccepted += new TakeEventDelegate(this.ComboRejestr_OnAfterAccepted);
                this.ComboRejestrOrg.Visible       = TraNag.TrN_Zaksiegowano != 0;
                this.ComboRejestr.Enabled          = TraNag.TrN_Zaksiegowano == 0;
                this.ComboRejestr.Visible          = TraNag.TrN_Zaksiegowano == 0;
                IEnumerable <Registy> enumerable;
                if (isModimmole)
                {
                    enumerable = this.ListaRejestrow.Where <Registy>(x => x.Code.StartsWith("M"));
                }
                else
                {
                    enumerable = this.ListaRejestrow.Where <Registy>(x => !x.Code.StartsWith("M"));
                }

                this.ComboRejestr.FromRaw = (from p in enumerable select string.Format("{0}|{1}*", p.Code, p.Name)).ToString <string>("|");
                //this.ComboRejestr.SelectedRaw = ((from p in enumerable select p.Code).ToList<string>().IndexOf(this.ComboRejestrOrg.ContentsRaw) ).ToString();
                //     Runtime.WindowController.UnlockThread();
                //MessageBox.Show("Test2", "Test", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //Runtime.WindowController.LockThread();

                this.ComboRejestr.SelectedRaw = ((from p in enumerable select p.Code).ToList <string>().IndexOf(this.ComboRejestrOrg.ContentsRaw) + 1).ToString();
                if (string.IsNullOrEmpty(ComboRejestrOrg.ContentsRaw) || enumerable.Where(x => x.Code.Contains(ComboRejestrOrg.ContentsRaw)).Count() == 0)
                {
                    this.ComboRejestr.SelectedRaw = 1.ToString();
                    string SelectValue = this.ComboRejestr.FromRaw.Split(new char[] { '|' })[(Convert.ToInt32(this.ComboRejestr.SelectedRaw) * 2) - 2];
                    this.ComboRejestrOrg.SelectedRaw = (this.ListaRejestrow.IndexOf(this.ListaRejestrow.Find(p => p.Code == SelectValue)) + 1).ToString();
                    this.ComboRejestrOrg.PostEvent(Events.Accepted);
                }
            }
            this.DataLock = false;
            return(true);
        }