public static void ReadOnly_Control(Control ctr)
        {
            try
            {
                foreach (Control txt in ctr.Controls)
                {
                    ReadOnly_Control(txt);
                    switch (txt.GetType().Name)
                    {
                    case "UltraTextEditor":
                    {
                        UltraTextEditor Ultratxt = txt as UltraTextEditor;
                        Ultratxt.ReadOnly = true;
                        break;
                    }

                    case "TextBox":
                    {
                        TextBox textboxtxt = txt as TextBox;
                        textboxtxt.ReadOnly = true;
                        break;
                    }

                    case "UltraCombo":
                    {
                        UltraCombo textboxtxt = txt as UltraCombo;
                        textboxtxt.ReadOnly = true;
                        break;
                    }

                    case "UltraComboEditor":
                    {
                        UltraComboEditor textboxtxt = txt as UltraComboEditor;
                        textboxtxt.ReadOnly = true;
                        break;
                    }

                    case "UltraDateTimeEditor":
                    {
                        UltraDateTimeEditor textboxtxt = txt as UltraDateTimeEditor;
                        textboxtxt.ReadOnly = true;
                        break;
                    }

                    case "UltraNumericEditor":
                    {
                        UltraNumericEditor textboxtxt = txt as UltraNumericEditor;
                        textboxtxt.ReadOnly = true;
                        break;
                    }
                    }
                }
            }
            catch (Exception)
            {
            }
        }
Example #2
0
 private void txtSplit_textChanged(object sender, EventArgs e)
 {
     try
     {
         UltraNumericEditor txt  = sender as UltraNumericEditor;
         DataRepeaterItem   item = (txt.Parent) as DataRepeaterItem;
         item.Controls["ultraLabel3"].Text = txt.Value.ToString();
     }
     catch (Exception e1)
     {
     }
 }
        public static void ReserAll(Control ctr)
        {
            try
            {
                foreach (Control txt in ctr.Controls)
                {
                    ReserAll(txt);
                    switch (txt.GetType().Name)
                    {
                    case "UltraTextEditor":
                    {
                        UltraTextEditor Ultratxt = txt as UltraTextEditor;
                        Ultratxt.Text = string.Empty;
                        break;
                    }

                    case "TextBox":
                    {
                        TextBox textboxtxt = txt as TextBox;
                        textboxtxt.Text = string.Empty;
                        break;
                    }

                    case "UltraCombo":
                    {
                        UltraCombo textboxtxt = txt as UltraCombo;
                        textboxtxt.Text = string.Empty;
                        break;
                    }

                    case "UltraComboEditor":
                    {
                        UltraComboEditor textboxtxt = txt as UltraComboEditor;
                        textboxtxt.Text = string.Empty;
                        break;
                    }

                    case "UltraNumericEditor":
                    {
                        UltraNumericEditor textboxtxt = txt as UltraNumericEditor;
                        textboxtxt.Value = 0;
                        break;
                    }
                    }
                }
            }
            catch (Exception)
            {
            }
        }
Example #4
0
        private void numeric_ValueChanged(object sender, EventArgs e)
        {
            /*
             * ultraNumericPostotakOlaksice valueChanged
             * ultraNumericIznosOlaksice valueChanged
             * **/
            UltraNumericEditor num = (UltraNumericEditor)sender;

            if (num.Value != null)
            {
                if (num.Value.ToString().Length == 0)
                {
                    num.Value = null;
                }
            }
            KontrolaUnosaIznosPostotak();
        }
Example #5
0
        private void CalcCountPlanRate(UltraCheckEditor cbx_Checked, UltraNumericEditor edt_Num, UltraCheckEditor cbx_Fcflag, Label lbl_Result)
        {
            try
            {
                UltraGridRow row = ultraGrid1.ActiveRow;

                if (ultraGrid1.Rows.Count <= 0 || row == null)
                {
                    lbl_Result.Text = "";
                    return;
                }

                if (!cbx_Checked.Checked || cbx_Fcflag.Checked)
                {
                    lbl_Result.Text = "";
                    return;
                }

                if (edt_Num.Value == null || string.IsNullOrEmpty(edt_Num.Value.ToString().Trim()))
                {
                    lbl_Result.Text = "";
                    return;
                }

                if (Edt_WgtLL.Value == null || string.IsNullOrEmpty(Edt_WgtLL.Value.ToString().Trim()))
                {
                    lbl_Result.Text = "";
                    return;
                }

                if (row.ParentRow != null)
                    row = row.ParentRow;

                string strTotal = Convert.ToString(row.Cells["FN_ZZ_WEIGHT"].Value).Trim();

                if (string.IsNullOrEmpty(strTotal) || strTotal.Equals("0"))
                {
                    strTotal = Convert.ToString(row.Cells["FN_ZC_ENTERWEIGHT"].Value).Trim();
                }

                if (string.IsNullOrEmpty(strTotal) || strTotal.Equals("0"))
                {
                    strTotal = Convert.ToString(row.Cells["FN_BILLET_WEIGHT"].Value).Trim();
                }

                if (string.IsNullOrEmpty(strTotal) || strTotal.Equals("0"))
                {
                    lbl_Result.Text = "";
                    return;
                }

                decimal dUnit = 0.0M;
                decimal dCount = 0.0M;
                decimal dTotal = 0.0M;

                bool bOK = decimal.TryParse(strTotal, out dTotal);

                if (!bOK)
                {
                    lbl_Result.Text = "";
                    return;
                }

                bOK = decimal.TryParse(edt_Num.Value.ToString().Trim(), out dCount);

                if (!bOK)
                {
                    lbl_Result.Text = "";
                    return;
                }

                bOK = decimal.TryParse(Edt_WgtLL.Value.ToString().Trim(), out dUnit);

                if (!bOK || dUnit <= 0)
                {
                    lbl_Result.Text = "";
                    return;
                }

                decimal dRate = Math.Round(100 * dCount * dUnit / dTotal, 2);

                if (dRate < 95.0M)
                {
                    lbl_Result.ForeColor = Color.Red;
                }
                else if (dRate > 107.0M)
                {
                    lbl_Result.ForeColor = Color.Blue;
                }
                else
                {
                    lbl_Result.ForeColor = Color.Green;
                }

                lbl_Result.Text = Convert.ToString(dRate) + "%";
            }
            catch
            {
                lbl_Result.Text = "";
            }
        }
        private void ddlGroupId_SelectedIndexChanged(object sender, EventArgs e)
        {
            ClearflowLayoutPanel();

            if (int.Parse(ddlGroupId.SelectedValue.ToString()) == -1)
            {
                unGroupId.Enabled = false;
                unItemId.Enabled  = false;

                return;
            }

            if (int.Parse(ddlGroupId.SelectedValue.ToString()) == ((int)ControlType.CadenaTextual)) //Cadena Textual
            {
                objTextBox = new TextBox();

                objTextBox.Name      = "text";
                objTextBox.Text      = "";
                objTextBox.Width     = 300;
                objTextBox.Height    = 21;
                unGroupId.Text       = "0";
                objTextBox.MaxLength = int.Parse(unMaxLenght.Text.ToString());

                flowLayoutPanel1.Controls.Add(objTextBox);

                unGroupId.Enabled   = false;
                unItemId.Enabled    = false;
                unMaxLenght.Enabled = true;
            }
            else if (int.Parse(ddlGroupId.SelectedValue.ToString()) == ((int)ControlType.CadenaMultilinea))  // Cadena Multimedia
            {
                unGroupId.Enabled   = false;
                unItemId.Enabled    = false;
                unMaxLenght.Enabled = true;

                objTextBox            = new TextBox();
                unGroupId.Text        = "0";
                objTextBox.Name       = "textMultiline";
                objTextBox.Text       = "";
                objTextBox.Width      = 300;
                objTextBox.Height     = 80;
                objTextBox.ScrollBars = ScrollBars.Vertical;
                objTextBox.Multiline  = true;
                objTextBox.MaxLength  = int.Parse(unMaxLenght.Text.ToString());

                flowLayoutPanel1.Controls.Add(objTextBox);
            }
            else if (int.Parse(ddlGroupId.SelectedValue.ToString()) == ((int)ControlType.NumeroEntero)) // Número Entero
            {
                une = new UltraNumericEditor()
                {
                    Width       = 100,
                    Height      = 21,
                    NumericType = NumericType.Integer,
                    PromptChar  = ' ',
                    Name        = "textNumericInteger"
                };
                unGroupId.Enabled   = false;
                unItemId.Enabled    = false;
                unMaxLenght.Text    = "1";
                unMaxLenght.Enabled = false;
                unGroupId.Text      = "0";
                flowLayoutPanel1.Controls.Add(une);
            }
            else if (int.Parse(ddlGroupId.SelectedValue.ToString()) == ((int)ControlType.NumeroDecimal))  // Número Decimal
            {
                une = new UltraNumericEditor()
                {
                    Width           = 100,
                    Height          = 21,
                    PromptChar      = ' ',
                    Name            = "textNumericDecimal",
                    NumericType     = NumericType.Double,
                    MaskDisplayMode = MaskMode.IncludeBoth
                };
                unGroupId.Enabled   = false;
                unItemId.Enabled    = false;
                unMaxLenght.Text    = "1";
                unMaxLenght.Enabled = false;
                unGroupId.Text      = "0";
                flowLayoutPanel1.Controls.Add(une);
            }
            else if (int.Parse(ddlGroupId.SelectedValue.ToString()) == ((int)ControlType.SiNoCheck)) //Sino Check
            {
                chk         = new CheckBox();
                chk.Checked = false;
                chk.Text    = "Si";
                flowLayoutPanel1.Controls.Add(chk);

                unGroupId.Enabled   = false;
                unItemId.Enabled    = false;
                unMaxLenght.Text    = "1";
                unMaxLenght.Enabled = false;
                unGroupId.Text      = "0";
            }
            else if (int.Parse(ddlGroupId.SelectedValue.ToString()) == ((int)ControlType.SiNoRadioButton)) //Sino Radio Button
            {
                rb1 = new RadioButton();
                rb2 = new RadioButton();

                rb1.Checked = true;
                rb1.Text    = "Si";
                rb1.Name    = "rbSi";

                rb2.Checked = false;
                rb2.Text    = "No";
                rb2.Name    = "rbNo";

                flowLayoutPanel1.Controls.Add(rb1);
                flowLayoutPanel1.Controls.Add(rb2);

                unGroupId.Enabled   = false;
                unItemId.Enabled    = false;
                unMaxLenght.Text    = "1";
                unMaxLenght.Enabled = false;
                unGroupId.Text      = "0";
            }
            else if (int.Parse(ddlGroupId.SelectedValue.ToString()) == ((int)ControlType.SiNoCombo)) // Sino Combo
            {
                OperationResult objOperationResult = new OperationResult();
                combo = new ComboBox();
                combo.DropDownStyle = ComboBoxStyle.DropDownList;
                flowLayoutPanel1.Controls.Add(combo);

                unGroupId.Enabled   = false;
                unItemId.Enabled    = false;
                unMaxLenght.Text    = "1";
                unMaxLenght.Enabled = false;
                unGroupId.Text      = "111";

                Utils.LoadDropDownList(combo, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 111, null), DropDownListAction.Select);
                flowLayoutPanel1.Controls.Add(combo);
            }
            else if (int.Parse(ddlGroupId.SelectedValue.ToString()) == ((int)ControlType.Lista))  // Lista
            {
                if (unGroupId.Text.ToString() == "")
                {
                    return;
                }

                unGroupId.Enabled   = true;
                unItemId.Enabled    = true;
                unMaxLenght.Text    = "1";
                unMaxLenght.Enabled = false;
                OperationResult objOperationResult = new OperationResult();
                combo = new ComboBox();
                combo.DropDownStyle = ComboBoxStyle.DropDownList;
                combo.Width         = 200;

                if (unGroupId.Text.ToString() != "0")
                {
                    Utils.LoadDropDownList(combo, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, int.Parse(unGroupId.Text.ToString()), null), DropDownListAction.Select);
                    flowLayoutPanel1.Controls.Add(combo);

                    if (_Mode == "Edit")
                    {
                        combo.SelectedValue = _DefaultText;
                    }
                }
            }
        }
Example #7
0
        public void SetNullItemClickBase(object sender, DataRow currentRow)
        {
            Control sourceControl = ((ContextMenu)((MenuItem)sender).Parent).SourceControl;
            string  controlId     = "";

            if (sourceControl.Tag != null)
            {
                controlId = Conversions.ToString(sourceControl.Tag);
            }
            if (sourceControl is DeklaritComboBox)
            {
                DeklaritComboBox box = (DeklaritComboBox)sourceControl;
                if (box.ComboBox.Tag != null)
                {
                    controlId         = Conversions.ToString(box.ComboBox.Tag);
                    box.SelectedIndex = -1;
                }
            }
            if ((controlId.Length == 0) && (sourceControl.Parent != null))
            {
                sourceControl = sourceControl.Parent;
                controlId     = Conversions.ToString(sourceControl.Tag);
            }
            this.GetControl(controlId).Focus();
            if (sourceControl is TextBox)
            {
                TextBox box2 = (TextBox)sourceControl;
                box2.Text = "";
            }
            if (sourceControl is UltraDateTimeEditor)
            {
                UltraDateTimeEditor editor = (UltraDateTimeEditor)sourceControl;
                editor.Value = RuntimeHelpers.GetObjectValue(Convert.DBNull);
            }
            if (sourceControl is UltraTextEditor)
            {
                UltraTextEditor editor2 = (UltraTextEditor)sourceControl;
                editor2.Text = "";
            }
            if (sourceControl is UltraNumericEditor)
            {
                UltraNumericEditor editor3 = (UltraNumericEditor)sourceControl;
                editor3.Value = RuntimeHelpers.GetObjectValue(Convert.DBNull);
            }
            if (sourceControl is UltraMaskedEdit)
            {
                UltraMaskedEdit edit = (UltraMaskedEdit)sourceControl;
                edit.Text = "";
            }
            if (sourceControl is LinkUltraLabelPrompt)
            {
                LinkUltraLabelPrompt prompt = (LinkUltraLabelPrompt)sourceControl;
                prompt.UltraLabel.Text = "";
                prompt.UltraLabel.Focus();
                string descriptionTag = prompt.DescriptionTag;
                if ((descriptionTag != null) && (descriptionTag.Length != 0))
                {
                    currentRow[descriptionTag] = RuntimeHelpers.GetObjectValue(Convert.DBNull);
                }
            }
            currentRow[controlId] = RuntimeHelpers.GetObjectValue(Convert.DBNull);
            DataColumn column = currentRow.Table.Columns[controlId];

            if (((column != null) && (column.ExtendedProperties["TreatEmptyAsNull"] != null)) && (Convert.ToBoolean(column.ExtendedProperties["TreatEmptyAsNull"].ToString()) && !column.DataType.Equals(typeof(DateTime))))
            {
                currentRow[controlId] = RuntimeHelpers.GetObjectValue(FormHelperClass.EmptyValue(column.DataType));
            }
        }
Example #8
0
        public Size GenerateTipsForm(Sys_PD_Module module, List<Sys_PD_Filed> filedList, Control ctr, Point p)
        {
            Sys_PD_RefModule refModule = new Sys_PD_RefModule();
            ctr.Tag = module;
            ctr.Text = module.SPM_Name;

            int iTabInex = 0;
            int xPosition = p.X;
            int yPosition = p.Y;
            int vXPosition = p.X;
            int step = 0;//控制一行已经输出多少列
            int fTI = module.SPM_TI;
            int fTX = module.SPM_TX;
            int fTY = module.SPM_TY;
            int fHeight = module.SPM_Height;
            int controlWidth = 0;
            int controlHeight = 0;

            Size lableSize = new Size(module.SPM_LX, module.SPM_LY);//标签的大小
            Size textSize = new Size(fTX, fTY);//文本框的大小
            Size areaSize = new Size((fTX * 2) + module.SPM_LX + module.SPM_LI, fTY * 3);//备注框大小
            foreach (Sys_PD_Filed field in filedList)
            {

                if (field.DCP_IsHidden == 1)
                {
                    UltraTextEditor _hiddenBox = new UltraTextEditor();
                    _hiddenBox.Location = new System.Drawing.Point(vXPosition, yPosition);
                    _hiddenBox.Name = module.SPM_TPrefix + field.DCP_ControlID;
                    _hiddenBox.Visible = false;
                    ctr.Controls.Add(_hiddenBox);
                    continue;
                }
                if (field.DCP_Style == "newline" ||
                    (field.DCP_ControlType == "textarea" &&
                    step > module.SPM_CNum - 2))
                {
                    step = 0;
                    vXPosition = xPosition;
                    yPosition += fHeight;
                }

                fTI = module.SPM_TI;
                fTX = module.SPM_TX;
                fTY = module.SPM_TY;
                fHeight = module.SPM_Height;
                textSize = new Size(fTX, fTY);//文本框的大小
                areaSize = new Size((fTX * 2) + module.SPM_LX + module.SPM_LI, fTY * 3);

                /////////如果字段有自定义的大小,则赋值到相关模块
                if (field.DCP_TI != 0 && field.DCP_TX != 0 && field.DCP_TY != 0 && field.DCP_Height != 0)
                {
                    textSize = new Size(field.DCP_TX, field.DCP_TY);
                    areaSize = new Size(field.DCP_TX, field.DCP_TY);
                    fTX = field.DCP_TX;
                    fTY = field.DCP_TY;
                    fTI = field.DCP_TI;
                    fHeight = field.DCP_Height;
                }

                Infragistics.Win.Misc.UltraLabel _lab = new Infragistics.Win.Misc.UltraLabel();
                _lab.Location = new Point(vXPosition, yPosition + 6);
                _lab.Name = module.SPM_LPrefix + field.DCP_ControlID.ToString();
                _lab.Size = lableSize;
                _lab.TabIndex = iTabInex++;
                _lab.Text = field.DCP_Label.ToString();
                ctr.Controls.Add(_lab);

                vXPosition += module.SPM_LI;

                #region 控件生成
                switch (field.DCP_ControlType)
                {
                    case "dec":
                        UltraNumericEditor _numBox = new UltraNumericEditor();
                        _numBox.Location = new System.Drawing.Point(vXPosition, yPosition);
                        _numBox.Name = module.SPM_TPrefix + field.DCP_ControlID;
                        _numBox.Size = textSize;
                        _numBox.NumericType = NumericType.Double;
                        _numBox.TabIndex = iTabInex++;
                        _numBox.PromptChar = ' ';
                        _numBox.Nullable = true;
                        _numBox.NullText = "0";
                        if (field.DCP_IsReadonly == 1)
                        {
                            _numBox.ReadOnly = true;
                        }
                        ctr.Controls.Add(_numBox);
                        break;
                    case "int":
                        UltraNumericEditor _intBox = new UltraNumericEditor();
                        _intBox.Location = new System.Drawing.Point(vXPosition, yPosition);
                        _intBox.Name = module.SPM_TPrefix + field.DCP_ControlID;
                        _intBox.Size = textSize;
                        _intBox.NumericType = NumericType.Integer;
                        _intBox.TabIndex = iTabInex++;
                        if (field.DCP_IsReadonly == 1)
                        {
                            _intBox.ReadOnly = true;
                        }
                        _intBox.PromptChar = ' ';
                        _intBox.Nullable = true;
                        _intBox.NullText = "";
                        ctr.Controls.Add(_intBox);
                        break;
                    case "text":
                        UltraTextEditor _textBox = new UltraTextEditor();
                        _textBox.Location = new System.Drawing.Point(vXPosition, yPosition);
                        _textBox.Name = module.SPM_TPrefix + field.DCP_ControlID;
                        _textBox.Size = textSize;
                        _textBox.TabIndex = iTabInex++;
                        _textBox.Nullable = true;
                        if (field.DCP_IsReadonly == 1)
                        {
                            _textBox.ReadOnly = true;
                        }
                        ctr.Controls.Add(_textBox);
                        break;
                    case "textl":
                        UltraTextEditor _texBox = new UltraTextEditor();
                        _texBox.Location = new System.Drawing.Point(vXPosition, yPosition);
                        _texBox.Name = module.SPM_TPrefix + field.DCP_ControlID;
                        _texBox.Size = new Size(textSize.Width * 2, textSize.Height);
                        _texBox.TabIndex = iTabInex++;
                        if (field.DCP_IsReadonly == 1)
                        {
                            _texBox.ReadOnly = true;
                        }
                        ctr.Controls.Add(_texBox);
                        step++;
                        vXPosition += (fTI + module.SPM_LI);
                        break;
                    case "textarea":

                        UltraTextEditor _mBox = new UltraTextEditor();
                        _mBox.Location = new System.Drawing.Point(vXPosition, yPosition);
                        _mBox.Name = module.SPM_TPrefix + field.DCP_ControlID;
                        _mBox.Multiline = true;
                        _mBox.Size = areaSize;
                        _mBox.TabIndex = iTabInex++;
                        if (field.DCP_IsReadonly == 1)
                        {
                            _mBox.ReadOnly = true;
                        }
                        ctr.Controls.Add(_mBox);
                        break;
                    case "date":
                        UltraDateTimeEditor _dateCom = new UltraDateTimeEditor();
                        _dateCom.BackColor = System.Drawing.SystemColors.Window;
                        _dateCom.MaskInput = "yyyy-mm-dd";
                        _dateCom.SpinButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.OnMouseEnter;
                        _dateCom.Location = new System.Drawing.Point(vXPosition, yPosition);
                        _dateCom.Name = module.SPM_TPrefix + field.DCP_ControlID;
                        _dateCom.Size = textSize;
                        _dateCom.TabIndex = iTabInex++;
                        _dateCom.Value = DateTime.Now;
                        _dateCom.PromptChar = ' ';
                        _dateCom.Nullable = true;
                        _dateCom.NullText = DateTime.Now.ToString();
                        if (field.DCP_IsReadonly == 1)
                        {
                            _dateCom.ReadOnly = true;
                        }
                        ctr.Controls.Add(_dateCom);
                        break;
                    case "time":
                        UltraDateTimeEditor _timeCom = new UltraDateTimeEditor();
                        _timeCom.BackColor = System.Drawing.SystemColors.Window;
                        _timeCom.MaskInput = "yyyy-mm-dd hh:mm";
                        _timeCom.SpinButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.OnMouseEnter;
                        _timeCom.Location = new System.Drawing.Point(vXPosition, yPosition);
                        _timeCom.Name = module.SPM_TPrefix + field.DCP_ControlID;
                        _timeCom.Size = textSize;
                        _timeCom.TabIndex = iTabInex++;
                        _timeCom.Value = DateTime.Now;
                        _timeCom.PromptChar = ' ';
                        _timeCom.Nullable = true;
                        _timeCom.NullText = DateTime.Now.ToString();
                        if (field.DCP_IsReadonly == 1)
                        {
                            _timeCom.ReadOnly = true;
                        }
                        ctr.Controls.Add(_timeCom);
                        break;
                    case "dict":
                        UltraComboEditor _comEdit = new UltraComboEditor();
                        _comEdit.Location = new System.Drawing.Point(vXPosition, yPosition);
                        _comEdit.Name = module.SPM_TPrefix + field.DCP_ControlID;
                        _comEdit.Size = textSize;
                        _comEdit.TabIndex = iTabInex++;
                        _comEdit.DropDownStyle = DropDownStyle.DropDownList;
                        _comEdit.Tag = field;
                        if (field.DCP_IsReadonly == 1)
                        {
                            _comEdit.ReadOnly = true;
                        }
                        _comEdit.ValueChanged += new EventHandler(_comEdit_ValueChanged);

                        ctr.Controls.Add(_comEdit);
                        //ExcuteWithReturnValue ddd = new ExcuteWithReturnValue(this.SetDictValue);

                        //ddd.BeginInvoke(_comEdit, field.DCP_Type, null, null);
                        SetDictValue(_comEdit, field.DCP_Type);
                        break;
                    case "ref":
                        #region UltraGrid 界面设置

                        UltraCombo uCom = new UltraCombo();
                        #endregion
                        uCom.Location = new System.Drawing.Point(vXPosition, yPosition);
                        uCom.Name = module.SPM_TPrefix + field.DCP_ControlID;
                        uCom.Size = textSize;
                        uCom.TabIndex = iTabInex++;
                        uCom.Tag = field;
                        //uCom.Text =
                        ctr.Controls.Add(uCom);
                        //if (uCom.Value == null)
                        //{
                        //    uCom.Value = "";
                        //}

                        string sql = string.Empty;
                        if (!string.IsNullOrEmpty(field.DCP_RefSQL))
                        {
                            refModule = instRef.GetListByWhere(string.Format(" and SPR_RefModule='{0}'", field.DCP_RefSQL)).FirstOrDefault();//获取参考
                            if (refModule != null)
                            {
                                sql = string.Format(refModule.SPR_RefSQL.Trim(), "", "");
                                DataTable refDate = new DataTable();
                                refDate = instField.GetRefData(sql);
                                uCom.DataSource = refDate.DefaultView;
                                uCom.DisplayMember = refModule.SPR_RefData;
                                uCom.ValueMember = refModule.SPR_RefValue;
                            }
                        }
                        if (!string.IsNullOrEmpty(field.DCP_PControl))
                        {
                            uCom.Enabled = false;
                        }

                        uCom.ValueChanged += new EventHandler(uCom_ValueChanged);
                        //uCom.BeforeDropDown += new System.ComponentModel.CancelEventHandler(uCom_BeforeDropDown);
                        uCom.TextChanged += new EventHandler(uCom_TextChanged);
                        //uCom.LostFocus += new EventHandler(uCom_LostFocus);
                        //uCom.InitializeLayout += new InitializeLayoutEventHandler(uCom_InitializeLayout);

                        if (field.DCP_IsReadonly == 1)
                        {
                            uCom.ReadOnly = true;
                        }
                        break;
                }
                #endregion

                if (field.DCP_ControlType == "textarea" && step + 2 < module.SPM_CNum - 2)
                {
                    vXPosition += fTI;//
                    step++;
                }
                else if (field.DCP_ControlType == "textarea" && step + 2 > module.SPM_CNum - 2)
                {
                    step = module.SPM_CNum - 1;

                    if (field.DCP_TI != 0 && field.DCP_TX != 0 && field.DCP_TY != 0 && field.DCP_Height != 0)
                    {
                        yPosition += fHeight;
                    }
                    else
                    {
                        yPosition += fHeight * 2 - 14; ;
                    }
                }

                vXPosition += fTI;
                if (controlWidth < vXPosition)
                {
                    controlWidth = vXPosition;
                }
                if (controlHeight < yPosition + module.SPM_Height)
                {
                    controlHeight = yPosition + module.SPM_Height;
                }
                if (step == module.SPM_CNum - 1)
                {
                    step = 0;
                    vXPosition = xPosition;
                    yPosition += module.SPM_Height;
                }
                else
                {
                    step++;
                }
            }
            ctr.Height = controlHeight;
            Size point = new Size(controlWidth + 20, controlHeight + 10);
            ctr.KeyUp += new KeyEventHandler(ctr_KeyUp);
            return point;
        }
Example #9
0
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmParametriFakturiranja));
     this.oddatuma   = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor();
     this.dodatuma   = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor();
     this.Button1    = new System.Windows.Forms.Button();
     this.Label1     = new System.Windows.Forms.Label();
     this.Label2     = new System.Windows.Forms.Label();
     this.CheckBox1  = new System.Windows.Forms.CheckBox();
     this.gbxDatum   = new System.Windows.Forms.GroupBox();
     this.gbxBrojURE = new System.Windows.Forms.GroupBox();
     this.uneDoURE   = new Infragistics.Win.UltraWinEditors.UltraNumericEditor();
     this.uneOdURE   = new Infragistics.Win.UltraWinEditors.UltraNumericEditor();
     this.label3     = new System.Windows.Forms.Label();
     this.label4     = new System.Windows.Forms.Label();
     this.rbrDatum   = new System.Windows.Forms.RadioButton();
     this.rbrBrojURE = new System.Windows.Forms.RadioButton();
     this.cbkPlaceni = new System.Windows.Forms.CheckBox();
     this.button2    = new System.Windows.Forms.Button();
     ((System.ComponentModel.ISupportInitialize)(this.oddatuma)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dodatuma)).BeginInit();
     this.gbxDatum.SuspendLayout();
     this.gbxBrojURE.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.uneDoURE)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.uneOdURE)).BeginInit();
     this.SuspendLayout();
     //
     // oddatuma
     //
     this.oddatuma.Location = new System.Drawing.Point(125, 17);
     this.oddatuma.Name     = "oddatuma";
     this.oddatuma.Size     = new System.Drawing.Size(144, 21);
     this.oddatuma.TabIndex = 0;
     //
     // dodatuma
     //
     this.dodatuma.Location = new System.Drawing.Point(125, 44);
     this.dodatuma.Name     = "dodatuma";
     this.dodatuma.Size     = new System.Drawing.Size(144, 21);
     this.dodatuma.TabIndex = 1;
     //
     // Button1
     //
     this.Button1.Location = new System.Drawing.Point(228, 128);
     this.Button1.Name     = "Button1";
     this.Button1.Size     = new System.Drawing.Size(75, 23);
     this.Button1.TabIndex = 2;
     this.Button1.Text     = "Ispiši";
     this.Button1.UseVisualStyleBackColor = true;
     this.Button1.Click += new System.EventHandler(this.Button1_Click);
     //
     // Label1
     //
     this.Label1.AutoSize = true;
     this.Label1.Location = new System.Drawing.Point(12, 24);
     this.Label1.Name     = "Label1";
     this.Label1.Size     = new System.Drawing.Size(62, 13);
     this.Label1.TabIndex = 3;
     this.Label1.Text     = "Od datuma:";
     //
     // Label2
     //
     this.Label2.AutoSize = true;
     this.Label2.Location = new System.Drawing.Point(12, 52);
     this.Label2.Name     = "Label2";
     this.Label2.Size     = new System.Drawing.Size(62, 13);
     this.Label2.TabIndex = 4;
     this.Label2.Text     = "Do datuma:";
     //
     // CheckBox1
     //
     this.CheckBox1.AutoSize = true;
     this.CheckBox1.Location = new System.Drawing.Point(12, 132);
     this.CheckBox1.Name     = "CheckBox1";
     this.CheckBox1.Size     = new System.Drawing.Size(130, 17);
     this.CheckBox1.TabIndex = 5;
     this.CheckBox1.Text     = "Ispis samo neplaćenih";
     this.CheckBox1.UseVisualStyleBackColor = true;
     //
     // gbxDatum
     //
     this.gbxDatum.Controls.Add(this.Label1);
     this.gbxDatum.Controls.Add(this.oddatuma);
     this.gbxDatum.Controls.Add(this.Label2);
     this.gbxDatum.Controls.Add(this.dodatuma);
     this.gbxDatum.Location = new System.Drawing.Point(12, 37);
     this.gbxDatum.Name     = "gbxDatum";
     this.gbxDatum.Size     = new System.Drawing.Size(279, 80);
     this.gbxDatum.TabIndex = 6;
     this.gbxDatum.TabStop  = false;
     this.gbxDatum.Visible  = false;
     //
     // gbxBrojURE
     //
     this.gbxBrojURE.Controls.Add(this.uneDoURE);
     this.gbxBrojURE.Controls.Add(this.uneOdURE);
     this.gbxBrojURE.Controls.Add(this.label3);
     this.gbxBrojURE.Controls.Add(this.label4);
     this.gbxBrojURE.Location = new System.Drawing.Point(12, 37);
     this.gbxBrojURE.Name     = "gbxBrojURE";
     this.gbxBrojURE.Size     = new System.Drawing.Size(297, 80);
     this.gbxBrojURE.TabIndex = 7;
     this.gbxBrojURE.TabStop  = false;
     this.gbxBrojURE.Visible  = false;
     //
     // uneDoURE
     //
     this.uneDoURE.Location    = new System.Drawing.Point(125, 48);
     this.uneDoURE.MaskInput   = "{LOC}-nnnnnnnnnn";
     this.uneDoURE.MaximumSize = new System.Drawing.Size(9999, 0);
     this.uneDoURE.MaxValue    = 9999999D;
     this.uneDoURE.MinValue    = 1;
     this.uneDoURE.Name        = "uneDoURE";
     this.uneDoURE.Nullable    = true;
     this.uneDoURE.NullText    = " ";
     this.uneDoURE.PromptChar  = ' ';
     this.uneDoURE.Size        = new System.Drawing.Size(166, 21);
     this.uneDoURE.TabIndex    = 53;
     //
     // uneOdURE
     //
     this.uneOdURE.Location    = new System.Drawing.Point(125, 20);
     this.uneOdURE.MaskInput   = "{LOC}-nnnnnnnnnn";
     this.uneOdURE.MaximumSize = new System.Drawing.Size(9999, 0);
     this.uneOdURE.MaxValue    = 9999999D;
     this.uneOdURE.MinValue    = 1;
     this.uneOdURE.Name        = "uneOdURE";
     this.uneOdURE.Nullable    = true;
     this.uneOdURE.NullText    = " ";
     this.uneOdURE.PromptChar  = ' ';
     this.uneOdURE.Size        = new System.Drawing.Size(166, 21);
     this.uneOdURE.TabIndex    = 52;
     //
     // label3
     //
     this.label3.AutoSize = true;
     this.label3.Location = new System.Drawing.Point(12, 24);
     this.label3.Name     = "label3";
     this.label3.Size     = new System.Drawing.Size(52, 13);
     this.label3.TabIndex = 3;
     this.label3.Text     = "OD URE:";
     //
     // label4
     //
     this.label4.AutoSize = true;
     this.label4.Location = new System.Drawing.Point(12, 52);
     this.label4.Name     = "label4";
     this.label4.Size     = new System.Drawing.Size(52, 13);
     this.label4.TabIndex = 4;
     this.label4.Text     = "DO URE:";
     //
     // rbrDatum
     //
     this.rbrDatum.AutoSize   = true;
     this.rbrDatum.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
     this.rbrDatum.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.rbrDatum.Location   = new System.Drawing.Point(12, 12);
     this.rbrDatum.Name       = "rbrDatum";
     this.rbrDatum.Size       = new System.Drawing.Size(99, 17);
     this.rbrDatum.TabIndex   = 7;
     this.rbrDatum.Text       = "Ispis po datumu";
     this.rbrDatum.TextAlign  = System.Drawing.ContentAlignment.MiddleRight;
     this.rbrDatum.UseVisualStyleBackColor = true;
     this.rbrDatum.CheckedChanged         += new System.EventHandler(this.rbrDatum_CheckedChanged);
     //
     // rbrBrojURE
     //
     this.rbrBrojURE.AutoSize = true;
     this.rbrBrojURE.Location = new System.Drawing.Point(168, 12);
     this.rbrBrojURE.Name     = "rbrBrojURE";
     this.rbrBrojURE.Size     = new System.Drawing.Size(113, 17);
     this.rbrBrojURE.TabIndex = 8;
     this.rbrBrojURE.Text     = "Ispis po broju URE";
     this.rbrBrojURE.UseVisualStyleBackColor = true;
     this.rbrBrojURE.CheckedChanged         += new System.EventHandler(this.rbrDatum_CheckedChanged);
     //
     // cbkPlaceni
     //
     this.cbkPlaceni.AutoSize = true;
     this.cbkPlaceni.Location = new System.Drawing.Point(12, 155);
     this.cbkPlaceni.Name     = "cbkPlaceni";
     this.cbkPlaceni.Size     = new System.Drawing.Size(112, 17);
     this.cbkPlaceni.TabIndex = 9;
     this.cbkPlaceni.Text     = "Ispis samo plaćeni";
     this.cbkPlaceni.UseVisualStyleBackColor = true;
     //
     // button2
     //
     this.button2.Location = new System.Drawing.Point(137, 128);
     this.button2.Name     = "button2";
     this.button2.Size     = new System.Drawing.Size(75, 23);
     this.button2.TabIndex = 10;
     this.button2.Text     = "Ispis PPO";
     this.button2.UseVisualStyleBackColor = true;
     this.button2.Click += new System.EventHandler(this.button2_Click);
     //
     // frmParametriFakturiranja
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(321, 190);
     this.Controls.Add(this.button2);
     this.Controls.Add(this.cbkPlaceni);
     this.Controls.Add(this.gbxBrojURE);
     this.Controls.Add(this.rbrBrojURE);
     this.Controls.Add(this.rbrDatum);
     this.Controls.Add(this.CheckBox1);
     this.Controls.Add(this.gbxDatum);
     this.Controls.Add(this.Button1);
     this.Icon          = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.MaximizeBox   = false;
     this.MinimizeBox   = false;
     this.Name          = "frmParametriFakturiranja";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text          = "Odabir parametara za ispis";
     ((System.ComponentModel.ISupportInitialize)(this.oddatuma)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dodatuma)).EndInit();
     this.gbxDatum.ResumeLayout(false);
     this.gbxDatum.PerformLayout();
     this.gbxBrojURE.ResumeLayout(false);
     this.gbxBrojURE.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.uneDoURE)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.uneOdURE)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Example #10
0
        private void repeaterVendorSplit_ItemCloned(object sender, Microsoft.VisualBasic.PowerPacks.DataRepeaterItemEventArgs e)
        {
            string constr = ConfigurationManager.ConnectionStrings["mverpConnectionString"].ConnectionString;

            try
            {
                UltraCombo CmbVend = e.DataRepeaterItem.Controls["comboVendor"] as UltraCombo;
                string     vend    = cmbPartNum.SelectedText;
                // dsRepeater = getDataSet("SELECT distinct vendor_code FROM [MIMDIST].[dbo].[apmaster] where status_type=5 and [vend_class_code]='VENDOR'    ", constr);
                dsRepeater = getDataSet("select vendor_code, address_name from dbo.apmaster where status_type = 5 and vend_class_code = 'VENDOR' AND vendor_code NOT LIKE 'DECOM%' AND flag_1099 = 1    ", constr);
                dtVendor   = dsRepeater.Tables[0];
                DataRow dr = dtVendor.NewRow();
                dr[0] = "SELECT";

                dtVendor.Rows.InsertAt(dr, 0);
                if (CmbVend.DataSource == null)
                {
                    CmbVend.DataSource    = dtVendor;
                    CmbVend.DisplayMember = "vendor_code";
                    CmbVend.ValueMember   = "vendor_code";
                }
                //   Cmb.SelectedIndexChanged += new EventHandler(comboVendor_SelectedIndexChanged);
                //    Cmb.SelectionChangeCommitted += new EventHandler(comboBox1_SelectionChangeCommitted);
                UltraNumericEditor txtsplit = e.DataRepeaterItem.Controls["txtSplit"] as UltraNumericEditor;
                //   txtsplit.Leave += new EventHandler(txtSplit_Leave);
                txtsplit.AfterExitEditMode += new EventHandler(txtSplit_AfterExitEditMode);
                // txtsplit.ValueChanged += new CancelEventHandler(txtSplit_BeforeEnterEditMode);
            }

            catch (Exception exp1) { MessageBox.Show(exp1.Message.ToString()); }

            try
            {
                UltraCombo Cmb = e.DataRepeaterItem.Controls["cmpCompPart"] as UltraCombo;
                // dsRepeater = getDataSet(" select sku_code as part_no from  v_vendor_split_parts_list  ", constr);
                dsRepeater = getDataSet(" select sku_code as part_no from  v_vendor_split_parts_list  ", constr);
                dtCompPart = dsRepeater.Tables[0];
                DataRow dr = dtCompPart.NewRow();
                dr[0] = "SELECT";

                dtCompPart.Rows.InsertAt(dr, 0);
                if (Cmb.DataSource == null)
                {
                    Cmb.DataSource    = dtCompPart;
                    Cmb.DisplayMember = "part_no";
                    Cmb.ValueMember   = "part_no";
                }
                //   if (lblPlanType.Text == "OPTION")
                // {
                Cmb.Visible = true;
                Infragistics.Win.Misc.UltraLabel lbl = e.DataRepeaterItem.Controls["ultraLabel3"] as Infragistics.Win.Misc.UltraLabel;
                lbl.Visible = true;
                //  }


                //    Cmb.SelectedIndexChanged += new EventHandler(combocom_SelectedIndexChanged);
                //  UltraNumericEditor txtsplit = e.DataRepeaterItem.Controls["txtSplit"] as UltraNumericEditor;
                //   txtsplit.Leave += new EventHandler(txtSplit_Leave);
                //   txtsplit.AfterExitEditMode += new EventHandler(txtSplit_AfterExitEditMode);
                // txtsplit.ValueChanged += new CancelEventHandler(txtSplit_BeforeEnterEditMode);
            }

            catch (Exception exp1) { MessageBox.Show(exp1.Message.ToString()); }
        }
Example #11
0
        public static void SetValue(Control control, string textValue, Type columnType)
        {
            IEnumerator enumerator = null;

            if (control is TextBox)
            {
                TextBox box = (TextBox)control;
                box.Text = textValue;
            }
            if (control is Label)
            {
                Label label = (Label)control;
                label.Text = textValue;
            }
            if (control is UltraLabel)
            {
                UltraLabel label2 = (UltraLabel)control;
                label2.Text = textValue;
            }
            if (control is UltraDateTimeEditor)
            {
                UltraDateTimeEditor editor = (UltraDateTimeEditor)control;
                editor.Text = textValue;
            }
            if (control is UltraTextEditor)
            {
                UltraTextEditor editor2 = (UltraTextEditor)control;
                editor2.Text = textValue;
            }
            if (control is UltraNumericEditor)
            {
                UltraNumericEditor editor3 = (UltraNumericEditor)control;
                if (editor3.NumericType == NumericType.Double)
                {
                    editor3.Value = double.Parse(textValue, CultureInfo.CurrentCulture);
                }
                else
                {
                    editor3.Value = long.Parse(textValue, CultureInfo.CurrentCulture);
                }
            }
            if (control is UltraMaskedEdit)
            {
                UltraMaskedEdit edit = (UltraMaskedEdit)control;
                edit.Text = textValue;
            }
            if (control is UltraCheckEditor)
            {
                UltraCheckEditor editor4 = (UltraCheckEditor)control;
                if ((textValue == "true") || (textValue == "True"))
                {
                    editor4.Checked = true;
                }
                else
                {
                    editor4.Checked = false;
                }
            }
            if (control is CheckBox)
            {
                CheckBox box2 = (CheckBox)control;
                if ((textValue == "true") || (textValue == "True"))
                {
                    box2.Checked = true;
                }
                else
                {
                    box2.Checked = false;
                }
            }
            if (!(control is ComboBox))
            {
                goto Label_0252;
            }
            ComboBox box3        = (ComboBox)control;
            object   objectValue = RuntimeHelpers.GetObjectValue(box3.SelectedValue);

            if (box3.DisplayMember == box3.ValueMember)
            {
                box3.SelectedIndex = box3.FindStringExact(textValue);
                goto Label_0252;
            }
            string valueMember = box3.ValueMember;

            valueMember = valueMember.Substring(valueMember.IndexOf(".") + 1);
            try
            {
                enumerator = box3.Items.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    object      obj3 = RuntimeHelpers.GetObjectValue(enumerator.Current);
                    DataRowView view = (DataRowView)obj3;
                    if (view.Row[valueMember].ToString().Trim().Equals(textValue.Trim()))
                    {
                        box3.SelectedItem = RuntimeHelpers.GetObjectValue(obj3);
                        goto Label_023F;
                    }
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
Label_023F:
            box3.SelectedValue = RuntimeHelpers.GetObjectValue(ConvertStringToTyped(textValue, columnType));
Label_0252:
            if (typeof(DeklaritComboBox).IsAssignableFrom(control.GetType()))
            {
                DeklaritComboBox box4 = (DeklaritComboBox)control;
                object           obj4 = RuntimeHelpers.GetObjectValue(box4.Value);
                if (box4.DisplayMember == box4.ValueMember)
                {
                    box4.SelectedIndex = box4.FindStringExact(textValue);
                }
                else
                {
                    string str2 = box4.ValueMember;
                    str2 = str2.Substring(str2.IndexOf(".") + 1);
                    ValueListItemEnumerator enumerator2 = box4.Items.GetEnumerator();
                    while (enumerator2.MoveNext())
                    {
                        ValueListItem current    = enumerator2.Current;
                        DataRowView   listObject = (DataRowView)current.ListObject;
                        if (listObject.Row[str2].ToString().Trim().Equals(textValue.Trim()))
                        {
                            box4.SelectedItem = current;
                            break;
                        }
                    }
                    box4.Value = RuntimeHelpers.GetObjectValue(ConvertStringToTyped(textValue, columnType));
                }
            }
            if (typeof(UltraComboEditor).IsAssignableFrom(control.GetType()))
            {
                UltraComboEditor editor5 = (UltraComboEditor)control;
                object           obj5    = RuntimeHelpers.GetObjectValue(editor5.Value);
                if (editor5.DisplayMember == editor5.ValueMember)
                {
                    editor5.SelectedIndex = editor5.FindStringExact(textValue);
                }
                else
                {
                    string str3 = editor5.ValueMember;
                    str3 = str3.Substring(str3.IndexOf(".") + 1);
                    ValueListItemEnumerator enumerator3 = editor5.Items.GetEnumerator();
                    while (enumerator3.MoveNext())
                    {
                        ValueListItem item2 = enumerator3.Current;
                        DataRowView   view3 = (DataRowView)item2.ListObject;
                        if (view3.Row[str3].ToString().Trim().Equals(textValue.Trim()))
                        {
                            editor5.SelectedItem = item2;
                            break;
                        }
                    }
                    editor5.Value = RuntimeHelpers.GetObjectValue(ConvertStringToTyped(textValue, columnType));
                }
            }
        }
Example #12
0
 public static void SetReadOnly(Control control, bool readOnlyValue)
 {
     if (control is TextBox)
     {
         TextBox box = (TextBox)control;
         box.ReadOnly = readOnlyValue;
     }
     if (control is Label)
     {
         Label label = (Label)control;
         label.Enabled = !readOnlyValue;
     }
     if (control is UltraDateTimeEditor)
     {
         UltraDateTimeEditor editor = (UltraDateTimeEditor)control;
         editor.Enabled = !readOnlyValue;
     }
     if (control is UltraTextEditor)
     {
         UltraTextEditor editor2 = (UltraTextEditor)control;
         editor2.Enabled = !readOnlyValue;
     }
     if (control is UltraNumericEditor)
     {
         UltraNumericEditor editor3 = (UltraNumericEditor)control;
         editor3.Enabled = !readOnlyValue;
     }
     if (control is UltraMaskedEdit)
     {
         UltraMaskedEdit edit = (UltraMaskedEdit)control;
         edit.Enabled = !readOnlyValue;
     }
     if (control is UltraCheckEditor)
     {
         UltraCheckEditor editor4 = (UltraCheckEditor)control;
         editor4.Enabled = !readOnlyValue;
     }
     if (control is CheckBox)
     {
         CheckBox box2 = (CheckBox)control;
         box2.Enabled = !readOnlyValue;
     }
     if (control is ComboBox)
     {
         ComboBox box3 = (ComboBox)control;
         box3.Enabled = !readOnlyValue;
     }
     if (control is Button)
     {
         Button button = (Button)control;
         button.Enabled = !readOnlyValue;
     }
     if (control is LinkUltraLabelPrompt)
     {
         LinkUltraLabelPrompt prompt = (LinkUltraLabelPrompt)control;
         prompt.Enabled = !readOnlyValue;
     }
     if (typeof(DeklaritComboBox).IsAssignableFrom(control.GetType()))
     {
         DeklaritComboBox box4 = (DeklaritComboBox)control;
         box4.Enabled = !readOnlyValue;
     }
     if (typeof(UltraComboEditor).IsAssignableFrom(control.GetType()))
     {
         UltraComboEditor editor5 = (UltraComboEditor)control;
         editor5.Enabled = !readOnlyValue;
     }
 }