示例#1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            string    fileName = inpLastName.Text + "~" + inpName.Text + "~" + inpBirthDay.Text + ".data";
            ArrayList eData    = fl.formSaveInFile(getControls(), fileName);

            eData.Add(pictPhotos.Name + "~" + sessionPhoto.Text);

            fio.saveDataInFile(this.dataDirFrag,
                               fileName,
                               eData);
            inpMessage.ForeColor = cl.hex("#006208");
            inpMessage.Text      = "Obsah formulára bol úspešne zapísaný do súboru, formulár je možné vymazať.";
            dataInFiles();
        }
示例#2
0
        public string contentInForm(ArrayList aControls,
                                    ArrayList aContent,
                                    string except)
        {
            controlsForm cnt = new controlsForm();
            Clibrary     cl  = new Clibrary();

            string[] aLine;
            string   returnValue = "";
            Color    okC         = cl.hex("#c4face");

            foreach (string line in aContent)
            {
                aLine = line.Split('~');
                if (aLine[0].IndexOf(except) > (-1))
                {
                    returnValue = aLine[1];
                }
                foreach (Control element in aControls)
                {
                    if (aLine[0].IndexOf(element.Name) > (-1))
                    {
                        cnt.element(false, element, aLine[1], true);
                    }
                }
            }
            return(returnValue);
        }
示例#3
0
        public void resetColor(Control element)
        {
            Clibrary cl = new Clibrary();

            if (element is TextBox ||
                element is ComboBox ||
                element is ListBox)
            {
                element.BackColor = cl.hex("#fff");
            }

            if (element is RadioButton ||
                element is CheckBox ||
                element.Name.IndexOf("session") == 0
                )
            {
                element.BackColor = cl.hex("#f0f0f0");
            }
        }
示例#4
0
        public string element(Boolean get, Control element, string value, Boolean bgColor)
        {
            Clibrary cl          = new Clibrary();
            string   returnValue = "";
            Color    newBgColor;

            if (element is TextBox ||
                element is ComboBox ||
                element is ListBox)
            {
                if (get)
                {
                    newBgColor = cl.hex("#fff");
                }
                else
                {
                    newBgColor = cl.hex("#c4face");
                }

                returnValue = textValue(get, element, value);
                if (bgColor)
                {
                    element.BackColor = newBgColor;
                }
            }

            if (element is CheckBox ||
                element is RadioButton)
            {
                newBgColor = cl.hex("#f0f0f0");
                if (value.ToLower().Trim().IndexOf("true") != 0 && value.ToLower().Trim().IndexOf("false") != 0)
                {
                    value = "false";
                }
                returnValue = checkValue(get, element, bool.Parse(value));
                if (bgColor)
                {
                    element.BackColor = newBgColor;
                }
            }
            return(returnValue);
        }
示例#5
0
        public void editImpact(ArrayList ePar, int okForm)
        {
            Clibrary cl = new Clibrary();
            Color    c;

            if (okForm == 1)
            {
                c = cl.hex("#c4face");
            }
            else
            {
                c = cl.hex("#fcdade");
            }


            if (ePar[0].GetType().ToString().IndexOf(".ListBox") > (-1))
            {
                ListBox element = (ListBox)ePar[0];
                element.BackColor = c;
            }

            if (ePar[0].GetType().ToString().IndexOf(".TextBox") > (-1))
            {
                TextBox element = (TextBox)ePar[0];
                element.BackColor = c;
            }

            if (ePar[0].GetType().ToString().IndexOf(".ComboBox") > (-1))
            {
                ComboBox element = (ComboBox)ePar[0];
                element.BackColor = c;
            }

            TextBox inpMessage = (TextBox)ePar[4];

            if (okForm == 1)
            {
                inpMessage.Text = "";
            }
        }
示例#6
0
        public void checkedImpact(ArrayList eChecks, ArrayList ePar, int okForm)
        {
            Clibrary cl = new Clibrary();
            Color    c;

            if (okForm == 1)
            {
                c = cl.hex("#c4face");
            }
            else
            {
                c = cl.hex("#fcdade");
            }

            if (ePar[0].GetType().ToString().IndexOf(".RadioButton") > (-1))
            {
                foreach (RadioButton element in eChecks)
                {
                    element.BackColor = c;
                }
            }

            if (ePar[0].GetType().ToString().IndexOf(".CheckBox") > (-1))
            {
                foreach (CheckBox element in eChecks)
                {
                    element.BackColor = c;
                }
            }

            TextBox inpMessage = (TextBox)ePar[2];

            if (okForm == 1)
            {
                inpMessage.Text = "";
            }
        }