Ejemplo n.º 1
0
        void FillDynamicValues(int IdDichvuChitiet, int idchidinhchitiet)
        {
            try
            {
                pnlDynamicValues.Controls.Clear();

                DataTable dtData = clsHinhanh.GetDynamicFieldsValues(IdDichvuChitiet, "", "", -1, idchidinhchitiet);

                foreach (DataRow dr in dtData.Select("1=1", "Stt_hthi"))
                {
                    dr[DynamicValue.Columns.IdChidinhchitiet] = Utility.Int32Dbnull(idchidinhchitiet);
                    ucDynamicParam _ucTextSysparam = new ucDynamicParam(dr, true);
                    _ucTextSysparam._ReadOnly = true;
                    _ucTextSysparam.TabStop = true;
                    _ucTextSysparam.TabIndex = 10 + Utility.Int32Dbnull(dr[DynamicField.Columns.Stt], 0);
                    _ucTextSysparam.Init();
                    _ucTextSysparam.Size = PropertyLib._DynamicInputProperties.DynamicSize;
                    _ucTextSysparam.txtValue.Size = PropertyLib._DynamicInputProperties.TextSize;
                    _ucTextSysparam.lblName.Size = PropertyLib._DynamicInputProperties.LabelSize;
                    pnlDynamicValues.Controls.Add(_ucTextSysparam);
                }
            }
            catch (Exception ex)
            {

            }
        }
        void _ucTextSysparam__OnEnterKey(ucDynamicParam obj)
        {
            try
            {
                if (!obj._AcceptTab)
                {
                    int _idx = -1;
                    var q = (from p in flowDynamics.Controls.Cast<ucDynamicParam>().AsEnumerable()
                             where p.TabIndex > obj.TabIndex
                             select p.TabIndex);
                    if (q.Count() > 0)
                        _idx = q.Min();
                    if (_idx > 0)
                    {
                        foreach (ucDynamicParam ucs in flowDynamics.Controls)
                        {
                            if (ucs.TabIndex == _idx)
                            {
                                ucs.FocusMe();
                                return;
                            }
                        }
                    }
                    else//Last Controls
                        cmdSave.Focus();
                }
            }
            catch (Exception)
            {

            }
        }
        void FillDynamicValues()
        {
            try
            {
                flowDynamics.Controls.Clear();

                DataTable dtData = clsHinhanh.GetDynamicFieldsValues(Utility.Int32Dbnull(txtIdDichvuChitiet.Text), "", "", -1, Utility.Int32Dbnull(txtidchidinhchitiet.Text));

                foreach (DataRow dr in dtData.Select("1=1","Stt_hthi"))
                {
                    dr[DynamicValue.Columns.IdChidinhchitiet] = Utility.Int32Dbnull(txtidchidinhchitiet.Text);
                    ucDynamicParam _ucTextSysparam = new ucDynamicParam(dr,true);

                    _ucTextSysparam.TabStop = true;
                    _ucTextSysparam._OnEnterKey += _ucTextSysparam__OnEnterKey;
                    _ucTextSysparam.TabIndex = 10 + Utility.Int32Dbnull(dr[DynamicField.Columns.Stt],0);

                    _ucTextSysparam.Init();
                    if (Utility.Byte2Bool(dr[DynamicField.Columns.Rtxt]))
                    {
                        _ucTextSysparam.Size = PropertyLib._DynamicInputProperties.RtfDynamicSize;
                        _ucTextSysparam.txtValue.Size = PropertyLib._DynamicInputProperties.RtfTextSize;
                        _ucTextSysparam.lblName.Size = PropertyLib._DynamicInputProperties.RtfLabelSize;
                    }
                    else
                    {
                        _ucTextSysparam.Size = PropertyLib._DynamicInputProperties.DynamicSize;
                        _ucTextSysparam.txtValue.Size = PropertyLib._DynamicInputProperties.TextSize;
                        _ucTextSysparam.lblName.Size = PropertyLib._DynamicInputProperties.LabelSize;
                    }
                    flowDynamics.Controls.Add(_ucTextSysparam);
                }
            }
            catch (Exception ex)
            {

            }
        }
Ejemplo n.º 4
0
        private void FillDynamicValues(int IdDichvuChitiet, int idchidinhchitiet)
        {
            try
            {
                pnlDynamicValues.Controls.Clear();

                DataTable dtData = clsHinhanh.GetDynamicFieldsValues(IdDichvuChitiet, "", "", -1, idchidinhchitiet);
                var lnkViewImage = new LinkLabel();
                lnkViewImage.Text = "Xem hình ảnh";
                lnkViewImage.Tag = idchidinhchitiet;
                lnkViewImage.Click += lnkViewImage_Click;
                pnlDynamicValues.Controls.Add(lnkViewImage);
                foreach (DataRow dr in dtData.Select("1=1", "Stt_hthi"))
                {
                    dr[DynamicValue.Columns.IdChidinhchitiet] = Utility.Int32Dbnull(idchidinhchitiet);
                    var _ucTextSysparam = new ucDynamicParam(dr, true);
                    _ucTextSysparam._ReadOnly = true;
                    _ucTextSysparam.onlyView = true;
                    _ucTextSysparam.TabStop = true;
                    _ucTextSysparam.TabIndex = 10 + Utility.Int32Dbnull(dr[DynamicField.Columns.Stt], 0);
                    _ucTextSysparam.Init();
                    if (Utility.Byte2Bool(dr[DynamicField.Columns.Rtxt]))
                    {
                        _ucTextSysparam.Size = PropertyLib._DynamicInputProperties.RtfDynamicSize;
                        _ucTextSysparam.txtValue.Size = PropertyLib._DynamicInputProperties.RtfTextSize;
                        _ucTextSysparam.lblName.Size = PropertyLib._DynamicInputProperties.RtfLabelSize;
                    }
                    else
                    {
                        _ucTextSysparam.Size = PropertyLib._DynamicInputProperties.DynamicSize;
                        _ucTextSysparam.txtValue.Size = PropertyLib._DynamicInputProperties.TextSize;
                        _ucTextSysparam.lblName.Size = PropertyLib._DynamicInputProperties.LabelSize;
                    }
                    pnlDynamicValues.Controls.Add(_ucTextSysparam);
                }
            }
            catch (Exception exception)
            {
                Utility.ShowMsg(exception.Message);
            }
        }