예제 #1
0
 public void MergeFormData(WebformData FormData, WebFormSchema FormSchema)
 {
     if (FormData.MultipleTables.ContainsKey(this.TableName) && FormData.MultipleTables[this.TableName].Count > 0)
     {
         SingleTable rows = FormData.MultipleTables[this.TableName];
         for (int i = 0; i < rows.Count; i++)
         {
             if (rows[i].RowId > 0)
             {
                 rows.RemoveAt(i--);
             }
         }
         if (rows.Count == 1)//one new entry// need to write code for 'AfterSaveRoutines'
         {
             foreach (TableSchema t in FormSchema.Tables)
             {
                 if (t.TableName != this.TableName)
                 {
                     FormData.MultipleTables.Remove(t.TableName);// approval execution, hence removing other data if present
                 }
             }
             string[] str_t = { FormConstants.stage_unique_id, FormConstants.action_unique_id, FormConstants.eb_my_actions_id, FormConstants.comments };
             for (int i = 0; i < str_t.Length; i++)
             {
                 EbControl con = this.Controls.Find(e => e.Name == str_t[i]);
                 FormData.MultipleTables[this.TableName][0].SetEbDbType(con.Name, con.EbDbType);
                 FormData.MultipleTables[this.TableName][0].SetControl(con.Name, con);
             }
         }
     }
 }
예제 #2
0
 public _FG_Control(EbControl Control, object Value)
 {
     this.Control  = Control;
     this.Name     = Control.Name;
     this.EbDbType = Control.EbDbType;
     this.Value    = Value;
 }
 public void DoDesignerLayout(pF.pDesigner.IpDesigner designer, EbControl serialized_ctrl)
 {
     this.EbControl = serialized_ctrl;
     this.Name      = serialized_ctrl.Name;
     this.Dock      = System.Windows.Forms.DockStyle.Fill;
     this.Text      = serialized_ctrl.Label;
 }
예제 #4
0
 private string GetFormattedData(EbControl ctrl, string value)// missing: ss !IsDynamic
 {
     try
     {
         if (ctrl is EbNumeric || ctrl is EbDGNumericColumn)
         {
             if (float.TryParse(value, out float val) && val != 0)
             {
                 value = ctrl.GetSingleColumn(this.WebForm.UserObj, this.WebForm.SolutionObj, value, false).F;
             }
             else
             {
                 value = string.Empty;
             }
         }
         else if (ctrl is EbBooleanSelect || ctrl is EbDGBooleanSelectColumn || ctrl is EbDGBooleanColumn || ctrl is EbRadioButton || ctrl is EbTextBox || ctrl is EbDGStringColumn)
         {
             value = ctrl.GetSingleColumn(this.WebForm.UserObj, this.WebForm.SolutionObj, value, false).F;
         }
         else if (value != null)
         {
             if (ctrl is EbDate || ctrl is EbDGDateColumn)
             {
                 value = ctrl.GetSingleColumn(this.WebForm.UserObj, this.WebForm.SolutionObj, value, false).F;
             }
         }
     }
     catch (Exception e)
     {
         Console.WriteLine("Exception in GetAuditTrail -> PreProcessTransationData -> GetFormattedData -> GetSingleColumn\nControl Name: " + ctrl.Name + "\nold_val/new_value Value: " + value + "\nMessage: " + e.Message);
     }
     return(value);
 }
 protected override void OnParentChanged(EventArgs e)
 {
     base.OnParentChanged(e);
     if (this.EbControl == null)
     {
         this.EbControl = new EbRadioGroup();
     }
 }
        public override void UpdateWebFormControl(EbControl control)
        {
            if (control == null || !(control is EbAutoId auto))
            {
                return;
            }

            base.UpdateWebFormControl(control);
        }
예제 #7
0
        public override void UpdateWebFormControl(EbControl control)
        {
            if (control == null || !(control is EbInputGeoLocation geo))
            {
                return;
            }

            base.UpdateWebFormControl(control);
        }
예제 #8
0
 public virtual void UpdateWebFormControl(EbControl control)
 {
     control.Label        = this.Label;
     control.Required     = this.Required;
     control.DoNotPersist = this.DoNotPersist;
     control.IsReadOnly   = this.ReadOnly;
     control.Hidden       = this.Hidden;
     control.Unique       = this.Unique;
 }
        public override void UpdateWebFormControl(EbControl control)
        {
            if (control == null || !(control is EbRadioGroup radioGroup))
            {
                return;
            }

            base.UpdateWebFormControl(control);
        }
        public override void UpdateWebFormControl(EbControl control)
        {
            if (control == null || !(control is EbDisplayPicture dp))
            {
                return;
            }

            base.UpdateWebFormControl(control);
        }
        public override void UpdateWebFormControl(EbControl control)
        {
            if (control == null || !(control is EbTextBox qr))
            {
                return;
            }

            base.UpdateWebFormControl(control);
        }
예제 #12
0
        public override void UpdateWebFormControl(EbControl control)
        {
            if (control == null || !(control is EbBooleanSelect boolean))
            {
                return;
            }

            base.UpdateWebFormControl(control);
        }
        public override void UpdateWebFormControl(EbControl control)
        {
            if (control == null || !(control is EbFileUploader fup))
            {
                return;
            }

            base.UpdateWebFormControl(control);

            fup.IsMultipleUpload = this.MultiSelect;
        }
        protected override void OnParentChanged(EventArgs e)
        {
            base.OnParentChanged(e);
            if (this.EbControl == null)
            {
                this.EbControl = new EbChart();
            }

            this.EbControl.Name = this.Name;
            this.Dock           = System.Windows.Forms.DockStyle.Fill;
        }
예제 #15
0
        public override void UpdateWebFormControl(EbControl control)
        {
            if (control == null || !(control is EbNumeric numeric))
            {
                return;
            }

            base.UpdateWebFormControl(control);

            numeric.MaxLimit = this.MaxLimit;
            numeric.MinLimit = this.MinLimit;
        }
예제 #16
0
        public override void UpdateWebFormControl(EbControl control)
        {
            if (control == null || !(control is EbDate date))
            {
                return;
            }

            base.UpdateWebFormControl(control);

            date.IsNullable = this.IsNullable;
            date.EbDateType = this.EbDateType;
        }
 public void SetControl(string name, EbControl control)
 {
     for (int i = 0; i < this.Columns.Count; i++)
     {
         if (this.Columns[i].Name.Equals(name))
         {
             this.Columns[i].Control = control;
             return;
         }
     }
     throw new KeyNotFoundException("KeyNotFoundException : Key = " + name);
 }
        protected override void OnParentChanged(EventArgs e)
        {
            base.OnParentChanged(e);

            if (this.EbControl == null)
            {
                this.EbControl = new EbDataGridView();
                //(this.EbControl as EbDataGridView).ColumnsChanged += EbDataGridViewControl_ColumnsChanged;
            }
            this.EbControl.Name = this.Name;
            this.Dock           = System.Windows.Forms.DockStyle.Fill;
        }
예제 #19
0
        public override void UpdateWebFormControl(EbControl control)
        {
            if (control == null || !(control is EbAudioInput fup))
            {
                return;
            }

            base.UpdateWebFormControl(control);

            fup.IsMultipleUpload = this.MultiSelect;
            fup.MaximumDUration  = this.MaximumDuration;
        }
        public override void UpdateWebFormControl(EbControl control)
        {
            if (control == null || !(control is EbRating rating))
            {
                return;
            }

            base.UpdateWebFormControl(control);

            rating.RatingColor = this.SelectionColor;
            rating.Spacing     = this.Spacing;
            rating.MaxVal      = this.MaxValue;
        }
        public override void UpdateWebFormControl(EbControl control)
        {
            if (control == null || !(control is EbTextBox textBox))
            {
                return;
            }

            base.UpdateWebFormControl(control);

            textBox.MaxLength       = this.MaxLength;
            textBox.TextTransform   = this.TextTransform;
            textBox.TextMode        = this.TextMode;
            textBox.AutoCompleteOff = this.AutoCompleteOff;
            textBox.AutoSuggestion  = this.AutoSuggestion;
        }
        public void DoDesignerLayout(pF.pDesigner.IpDesigner designer, EbControl serialized_ctrl)
        {
            this.EbControl = serialized_ctrl;
            this.Name      = serialized_ctrl.Name;
            this.Text      = serialized_ctrl.Label;

            if (this.EbControl.CellPositionColumn > 0 && this.EbControl.CellPositionRow > 0)
            {
                this.Dock = DockStyle.Fill;
            }
            else
            {
                this.Location = new System.Drawing.Point(this.EbControl.Left, this.EbControl.Top);
                this.Size     = new System.Drawing.Size(this.EbControl.Width, this.EbControl.Height);
            }
        }
        public void DoDesignerLayout(pF.pDesigner.IpDesigner designer, EbControl serialized_ctrl)
        {
            this.EbControl = serialized_ctrl;
            this.Name      = serialized_ctrl.Name;
            this.Dock      = DockStyle.Fill;
            this.Text      = serialized_ctrl.Label;

            //foreach (EbDataGridViewColumn col in (serialized_ctrl as EbDataGridView).Columns)
            //{
            //    this.Columns.Add(new DataGridViewTextBoxColumn
            //    {
            //        Name = col.Name,
            //        HeaderText = col.Label,
            //        Width = col.Width
            //    });
            //}
        }
예제 #24
0
        public override void UpdateWebFormControl(EbControl control)
        {
            if (control != null)
            {
                base.UpdateWebFormControl(control);

                if (control is EbSimpleSelect simpleSelect)
                {
                    this.SetSimpleSelectOptions(simpleSelect);
                }
                else if (control is EbPowerSelect powerSelect)
                {
                    powerSelect.DataSourceId = this.DataSourceRefId;
                    this.SetDisplayMember(powerSelect);
                    this.SetValueMember(powerSelect);
                }
            }
        }
예제 #25
0
        public EbWebForm GenerateWebForm(string displayName)
        {
            string guid = Guid.NewGuid().ToString("N");

            EbWebForm webForm = new EbWebForm
            {
                EbSid       = guid,
                Name        = guid,
                DisplayName = displayName + " (Web)",
                TableName   = this.TableName,
                Padding     = new UISides {
                    Top = 20, Right = 20, Bottom = 20, Left = 20
                }
            };

            Dictionary <string, int> counter = new Dictionary <string, int>();

            foreach (EbMobileControl ctrl in this.ChildControls)
            {
                if (ctrl is EbMobileTableLayout tableLayout)
                {
                    foreach (EbMobileTableCell cell in tableLayout.CellCollection)
                    {
                        foreach (EbMobileControl tableCtrl in cell.ControlCollection)
                        {
                            int       count     = this.GetControlCount(tableCtrl, counter);
                            EbControl ebControl = tableCtrl.GetWebFormControl(count);
                            webForm.Controls.Add(ebControl);
                        }
                    }
                }
                else if (ctrl is EbMobileDataGrid)
                {
                    continue;
                }
                else
                {
                    int       count     = this.GetControlCount(ctrl, counter);
                    EbControl ebControl = ctrl.GetWebFormControl(count);
                    webForm.Controls.Add(ebControl);
                }
            }
            return(webForm);
        }
예제 #26
0
        private void CreateOrUpdateControl(EbWebForm webForm, List <EbControl> flatControls, EbMobileControl ctrl, Dictionary <string, int> counter)
        {
            EbControl control = flatControls.Find(c => c.Name == ctrl.Name);

            if (control != null)
            {
                string cType = control.GetType().Name;

                if (!counter.ContainsKey(cType))
                {
                    counter[cType] = 0;
                }
                try
                {
                    MatchCollection cmatch = CounterRegex.Matches(control.EbSid);
                    if (cmatch.Count > 0)
                    {
                        int c = Convert.ToInt32(cmatch.LastOrDefault().Value);
                        counter[cType] = counter[cType] < c ? c : counter[cType];
                    }
                }
                catch (Exception ex)
                {
                    counter[cType]++;
                    Console.WriteLine(ex.Message);
                    Console.WriteLine(ex.StackTrace);
                }
                ctrl.UpdateWebFormControl(control);
            }
            else
            {
                string name = ctrl.EbControlType;
                counter[name] = counter.ContainsKey(name) ? ++counter[name] : 0;
                webForm.Controls.Add(ctrl.GetWebFormControl(counter[name]));
            }
        }
 public void DoDesignerLayout(pF.pDesigner.IpDesigner designer, EbControl serialized_ctrl)
 {
     this.EbControl        = serialized_ctrl;
     this.EbControl.Parent = this;
     this.DoDesignerRefresh();
 }
 public EbTextBoxControl()
 {
     this.EbControl = new EbTextBox(this);
 }
예제 #29
0
 public EbComboBoxControl()
 {
     this.EbControl = new EbComboBox(this);
 }
 public EbNumericControl()
 {
     this.EbControl = new EbNumeric(this);
 }