Пример #1
0
        private bool TryInsertIntegrationAdapterField()
        {
            bool success = false;

            try
            {
                TextBox      txtFieldName          = this.dgvList.FooterRow.FindControl("txtFieldName") as TextBox;
                DropDownList cmbFieldDataType      = this.dgvList.FooterRow.FindControl("cmbFieldDataType") as DropDownList;
                CheckBox     chkIsPrimaryKey       = this.dgvList.FooterRow.FindControl("chkIsPrimaryKey") as CheckBox;
                TextBox      txtPrimaryKeySequence = this.dgvList.FooterRow.FindControl("txtPrimaryKeySequence") as TextBox;
                TextBox      txtDescription        = this.dgvList.FooterRow.FindControl("txtDescription") as TextBox;

                if (txtFieldName != null && cmbFieldDataType != null && chkIsPrimaryKey != null && txtPrimaryKeySequence != null && txtDescription != null)
                {
                    IntegrationAdapterField _IntegrationAdapterField = new IntegrationAdapterField()
                    {
                        FieldName          = txtFieldName.Text,
                        FieldDataType      = cmbFieldDataType.SelectedValue.SafeIntegerParse(),
                        IsPrimaryKey       = chkIsPrimaryKey.Checked,
                        PrimaryKeySequence = txtDescription.Text.SafeByteParse(1),
                        FieldCategory      = FieldCategory.Standard.GetValue <int>(),
                        Description        = txtDescription.Text.Trim(),
                    };

                    success = this.Presenter.InsertIntegrationAdapterField(_IntegrationAdapterField) > 0;
                }
            }
            catch (System.Exception ex)
            {
                LogManager.LogException(ex);
            }

            return(success);
        }
Пример #2
0
        protected void dgvList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            IntegrationAdapterField field = e.Row.DataItem as IntegrationAdapterField;

            if (field != null && field.IsRowVisible == false)
            {
                e.Row.Visible = false;
            }
        }
        /// <summary>
        /// Update Integration Adapter Field
        /// </summary>
        /// <param name="pEntity"></param>
        /// <returns></returns>
        public int UpdateIntegrationAdapterField(IntegrationAdapterField pEntity)
        {
            int results = 0;

            try
            {
                pEntity.IntegrationAdapterID = this.Entity.IntegrationAdapterID;

                DataUtilities.UpdateRecordAuditInfo(pEntity);
                results = base.AppRuntime.DataService.UpdateEntity(pEntity);
            }
            catch (Exception ex)
            {
                LogManager.LogException(ex);
            }

            return(results);
        }
        /// <summary>
        /// Delete Integration Adapter Field
        /// </summary>
        /// <param name="pEntity"></param>
        /// <returns></returns>
        public int DeleteIntegrationAdapterField(IntegrationAdapterField pEntity)
        {
            int results = 0;

            try
            {
                pEntity = base.AppRuntime.DataService.GetEntity <IntegrationAdapterField>(pEntity.IntegrationAdapterFieldID);

                if (pEntity != null)
                {
                    results = base.AppRuntime.DataService.DeleteEntity(pEntity);
                }
            }
            catch (Exception ex)
            {
                LogManager.LogException(ex);
            }

            return(results);
        }