Пример #1
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);
        }
Пример #2
0
        public int simpleControl(ArrayList ePars)
        {
            string matchType   = (string)ePars[1];
            int    minSize     = (int)ePars[2];
            string elementText = (string)ePars[ePars.Count - 1];


            Clibrary cl = new Clibrary();

            int correct = 0;

            correct = cl.regMatch(matchType, elementText, minSize);

            if (minSize == 0)
            {
                correct = 1;
            }
            return(correct);
        }
Пример #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 = "";
            }
        }