Esempio n. 1
0
        protected BaleEntity(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            if (SerializationHelper.Optimization != SerializationOptimization.Fast)
            {
                _account = (AccountEntity)info.GetValue("_account", typeof(AccountEntity));
                if (_account != null)
                {
                    _account.AfterSave += new EventHandler(OnEntityAfterSave);
                }
                _dock = (DockEntity)info.GetValue("_dock", typeof(DockEntity));
                if (_dock != null)
                {
                    _dock.AfterSave += new EventHandler(OnEntityAfterSave);
                }
                _recycleType = (RecycleTypeEntity)info.GetValue("_recycleType", typeof(RecycleTypeEntity));
                if (_recycleType != null)
                {
                    _recycleType.AfterSave += new EventHandler(OnEntityAfterSave);
                }

                base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
            }

            // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
            // __LLBLGENPRO_USER_CODE_REGION_END
        }
Esempio n. 2
0
 /// <summary> setups the sync logic for member _recycleType</summary>
 /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
 private void SetupSyncRecycleType(IEntity2 relatedEntity)
 {
     if (_recycleType != relatedEntity)
     {
         DesetupSyncRecycleType(true, true);
         _recycleType = (RecycleTypeEntity)relatedEntity;
         base.PerformSetupSyncRelatedEntity(_recycleType, new PropertyChangedEventHandler(OnRecycleTypePropertyChanged), "RecycleType", ServiceLocationRecycleTypeEntity.Relations.RecycleTypeEntityUsingRecycleTypeId, true, new string[] {  });
     }
 }
Esempio n. 3
0
        public static RecycleTypeEntityData RecycleTypeEntityToData(RecycleTypeEntity entity)
        {
            var data = new RecycleTypeEntityData();

            data.RecycleTypeId = entity.RecycleTypeId;
            data.Name          = entity.Name;

            return(data);
        }
Esempio n. 4
0
 public void rdRecycleTypeGrid_DeleteCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
 {
     if (e.CommandName == "delete")
     {
         var a    = Convert.ToInt32(e.CommandArgument);
         var type = new RecycleTypeEntity(a);
         type.IsActive = false;
         type.Save();
     }
 }
Esempio n. 5
0
        /// <summary> Initializes the class members</summary>
        protected virtual void InitClassMembers()
        {
            _recycleType     = null;
            _serviceLocation = null;

            PerformDependencyInjection();

            // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
            // __LLBLGENPRO_USER_CODE_REGION_END

            OnInitClassMembersComplete();
        }
Esempio n. 6
0
        protected void btnSaveRecycleType_Click(object sender, EventArgs e)
        {
            if (txtName.Text.Trim().Length > 0)
            {
                RecycleTypeEntity rte = new RecycleTypeEntity();
                rte.Name         = txtName.Text.Trim();
                rte.Description  = txtDescription.Text.Trim().Length > 0 ? txtDescription.Text.Trim() : null;
                rte.SpanishLabel = txtSpanishLabel.Text.Trim().Length > 0 ? txtSpanishLabel.Text.Trim() : null;
                rte.Save();

                txtName.Text         = "";
                txtDescription.Text  = "";
                txtSpanishLabel.Text = "";

                txtName.Focus();
                rdRecycleTypeGrid.Rebind();
            }
        }
Esempio n. 7
0
        protected void btnSaveRecycleTypeChanges_Click(object sender, EventArgs e)
        {
            foreach (GridDataItem recycleItem in rdRecycleTypeGrid.Items)
            {
                Hashtable typeValues = new Hashtable();
                recycleItem.ExtractValues(typeValues);
                int recycleTypeId             = Convert.ToInt32(typeValues["RecycleTypeId"].ToString());
                RecycleTypeEntity recycleType = new RecycleTypeEntity(recycleTypeId);

                TextBox txtName = recycleItem.FindControl("txtRecycleTypeName") as TextBox;
                TextBox txtRecycleTypeDescription = recycleItem.FindControl("txtRecycleTypeDescription") as TextBox;
                TextBox txtSpanishLabel           = recycleItem.FindControl("txtSpanishLabel") as TextBox;

                recycleType.Name         = txtName.Text.Trim().Length > 0 ? txtName.Text.Trim() : "";
                recycleType.Description  = txtRecycleTypeDescription.Text.Trim().Length > 0 ? txtRecycleTypeDescription.Text.Trim() : "";
                recycleType.SpanishLabel = txtSpanishLabel.Text.Trim().Length > 0 ? txtSpanishLabel.Text.Trim() : "";

                recycleType.Save();
            }
        }
Esempio n. 8
0
        protected ServiceLocationRecycleTypeEntity(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            if (SerializationHelper.Optimization != SerializationOptimization.Fast)
            {
                _recycleType = (RecycleTypeEntity)info.GetValue("_recycleType", typeof(RecycleTypeEntity));
                if (_recycleType != null)
                {
                    _recycleType.AfterSave += new EventHandler(OnEntityAfterSave);
                }
                _serviceLocation = (ServiceLocationEntity)info.GetValue("_serviceLocation", typeof(ServiceLocationEntity));
                if (_serviceLocation != null)
                {
                    _serviceLocation.AfterSave += new EventHandler(OnEntityAfterSave);
                }

                base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
            }

            // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
            // __LLBLGENPRO_USER_CODE_REGION_END
        }
Esempio n. 9
0
 /// <summary> Removes the sync logic for member _recycleType</summary>
 /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
 /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
 private void DesetupSyncRecycleType(bool signalRelatedEntity, bool resetFKFields)
 {
     base.PerformDesetupSyncRelatedEntity(_recycleType, new PropertyChangedEventHandler(OnRecycleTypePropertyChanged), "RecycleType", ServiceLocationRecycleTypeEntity.Relations.RecycleTypeEntityUsingRecycleTypeId, true, signalRelatedEntity, "ServiceLocationRecycleType", resetFKFields, new int[] { (int)ServiceLocationRecycleTypeFieldIndex.RecycleTypeId });
     _recycleType = null;
 }