public override bool Collect(AbstractDataCollector <TEntity> collector)
        {
            if (collector == null)
            {
                return(false);
            }

            ActiveCollector = collector;

            ID = ((IUserGroupViewer)ActiveCollector.ActiveViewer).ID;

            if (ActiveDBItem == null)
            {
                return(false);
            }

            if (NameP != null)
            {
                ((UserGroup_cu)ActiveDBItem).Name_P = NameP.ToString();
            }

            if (NameS != null)
            {
                ((UserGroup_cu)ActiveDBItem).Name_S = NameS.ToString();
            }

            if (InternalCode != null)
            {
                ((UserGroup_cu)ActiveDBItem).InternalCode = InternalCode.ToString();
            }

            if (Description != null)
            {
                ((UserGroup_cu)ActiveDBItem).Description = Description.ToString();
            }

            if (UserID != null)
            {
                ((UserGroup_cu)ActiveDBItem).InsertedBy = Convert.ToInt32(UserID);
            }

            ((UserGroup_cu)ActiveDBItem).IsOnDuty = true;
            switch (((IUserGroupViewer)ActiveCollector.ActiveViewer).CommonTransactionType)
            {
            case DB_CommonTransactionType.DeleteExisting:
                ((UserGroup_cu)ActiveDBItem).IsOnDuty = false;
                break;
            }

            RelatedViewers = ((IUserGroupViewer)ActiveCollector.ActiveViewer).RelatedViewers;

            return(true);
        }
        public override bool Collect(AbstractDataCollector <TEntity> collector)
        {
            if (collector == null)
            {
                return(false);
            }

            ActiveCollector = collector;

            ID = ((IServiceCategoryViewer)ActiveCollector.ActiveViewer).ID;

            if (ActiveDBItem == null)
            {
                return(false);
            }

            if (NameP != null)
            {
                ((ServiceCategory_cu)ActiveDBItem).Name_P = NameP.ToString();
            }

            if (NameS != null)
            {
                ((ServiceCategory_cu)ActiveDBItem).Name_S = NameS.ToString();
            }

            if (InternalCode != null)
            {
                ((ServiceCategory_cu)ActiveDBItem).InternalCode = InternalCode.ToString();
            }

            if (ServiceType != null)
            {
                ((ServiceCategory_cu)ActiveDBItem).ServiceType_P_ID = Convert.ToInt32(ServiceType);
            }

            ((ServiceCategory_cu)ActiveDBItem).IsMedical = Convert.ToBoolean(IsMedical);

            ((ServiceCategory_cu)ActiveDBItem).AllowAdmission = Convert.ToBoolean(AlloAdmission);

            if (Description != null)
            {
                ((ServiceCategory_cu)ActiveDBItem).Description = Description.ToString();
            }

            if (UserID != null)
            {
                ((ServiceCategory_cu)ActiveDBItem).InsertedBy = Convert.ToInt32(UserID);
            }

            ((ServiceCategory_cu)ActiveDBItem).IsOnDuty = true;
            switch (((IServiceCategoryViewer)ActiveCollector.ActiveViewer).CommonTransactionType)
            {
            case DB_CommonTransactionType.DeleteExisting:
                ((ServiceCategory_cu)ActiveDBItem).IsOnDuty = false;
                break;
            }

            RelatedViewers = ((IServiceCategoryViewer)ActiveCollector.ActiveViewer).RelatedViewers;

            return(true);
        }