public EmployeeSchedulerPage(UnicontaBaseEntity master)
            : base(master)
        {
            InitializeComponent();
            this.DataContext         = this;
            MainControl              = employeeScheduler;
            ribbonControl            = frmRibbon;
            frmRibbon.OnItemClicked += frmRibbon_OnItemClicked;
            employeeScheduler.AppointmentWindowShowing += EmployeeScheduler_AppointmentWindowShowing;
            employeeScheduler.ItemPropertyChanged      += EmployeeScheduler_ItemPropertyChanged;
            employeeScheduler.Loaded                       += EmployeeScheduler_Loaded;
            employeeScheduler.InitNewAppointment           += EmployeeScheduler_InitNewAppointment;
            employeeScheduler.AppointmentDrop              += EmployeeScheduler_AppointmentDrop;
            employeeScheduler.AppointmentResize            += EmployeeScheduler_AppointmentResize;
            employeeScheduler.AllowAppointmentEdit          = true;
            employeeScheduler.AllowAppointmentDelete        = true;
            employeeScheduler.AllowInplaceEditor            = true;
            employeeScheduler.CustomAllowAppointmentEdit   += EmployeeScheduler_CustomAllowAppointmentEdit;
            employeeScheduler.CustomAllowInplaceEditor     += EmployeeScheduler_CustomAllowInplaceEditor;
            employeeScheduler.CustomAllowAppointmentDelete += EmployeeScheduler_CustomAllowAppointmentDelete;
            employeeScheduler.TaskDataType                  = master.GetType();
            RemoveMenuItem();

            if (master != null)
            {
                Employee    = master as EmployeeClient;
                _employee   = Employee.Number;
                _masterList = new List <UnicontaBaseEntity>();
                _masterList.Add(master);
                GetMappings();
            }
        }
        string GetValues(UnicontaBaseEntity oldRecord, UnicontaBaseEntity newRecord, bool IsNewValue)
        {
            if (oldRecord == null)
            {
                return(null);
            }
            var prop = oldRecord.GetType().GetProperty(this._PropName);

            if (prop != null)
            {
                return(CheckProperty(oldRecord, newRecord, IsNewValue, prop));
            }
            StringBuilderReuse values    = null;
            string             singleVal = null;

            foreach (var RecProperty in oldRecord.GetType().GetProperties())
            {
                var val = CheckProperty(oldRecord, newRecord, IsNewValue, RecProperty);
                if (val != null)
                {
                    if (singleVal == null)
                    {
                        singleVal = val;
                    }
                    else
                    {
                        if (values == null)
                        {
                            values = StringBuilderReuse.Create();
                            values.Append(singleVal);
                        }
                        values.Append(';').Append(val);
                    }
                }
            }
            return((values != null) ? values.ToStringAndRelease() : singleVal);
        }
 public EmployeeTaskSchedulerPage(UnicontaBaseEntity master)
     : base(master)
 {
     InitializeComponent();
     employeeScheduler.EditAppointmentFormShowing     += employeeScheduler_EditAppointmentFormShowing;
     employeeScheduler.AppointmentViewInfoCustomizing += employeeScheduler_AppointmentViewInfoCustomizing;
     employeeScheduler.PopupMenuShowing += employeeScheduler_PopupMenuShowing;
     employeeScheduler.SchedulerAppointmentActionEvent += employeeScheduler_SchedulerAppointmentActionEvent;
     employeeScheduler.StorageAppointmentActionEvent   += employeeScheduler_StorageAppointmentActionEvent;
     employeeScheduler.TaskDataType = master.GetType();
     if (master != null)
     {
         var empClient = master as EmployeeClient;
         _employee   = empClient.Number;
         _masterList = new List <UnicontaBaseEntity>();
         _masterList.Add(master);
         InitPage();
     }
 }
Exemple #4
0
        async private void GenerateClassCode(UnicontaBaseEntity master, bool isBaseClass)
        {
            string className = string.Empty;

            if (isBaseClass)
            {
                className = master.BaseEntityType().Name;
            }
            else
            {
                className = master.GetType().Name;
            }

            var userFields = await api.Query <TableFieldsClient>(master);

            var classCode = ClassGenerator.Create(className, userFields, isBaseClass);

            var cwGenerateClass = new CWGenerateClass(classCode);

            cwGenerateClass.Show();
        }
Exemple #5
0
        public override void Utility_Refresh(string screenName, object argument = null)
        {
            if (screenName == TabControls.AddUserFieldsPage2)
            {
                object[] argumentParams = (object[])argument;
                var      Row            = argumentParams[1] as TableFieldsClient;
                if (Row == null)
                {
                    return;
                }

                var rowType        = Row.master.GetType();
                var pageMasterType = master.GetType();

                var rowMaster = Row.master as Uniconta.DataModel.TableHeader;
                if (rowMaster != null)
                {
                    int pageMasterTableId     = 0;
                    var argumentMasterTableId = rowMaster.RowId;

                    if (master is Uniconta.DataModel.TableHeader)
                    {
                        pageMasterTableId = ((Uniconta.DataModel.TableHeader)master).RowId;
                    }

                    if (rowType == pageMasterType && argumentMasterTableId == pageMasterTableId)
                    {
                        dgUserField.UpdateItemSource(argument);
                    }
                }
                else if (rowType == pageMasterType)
                {
                    dgUserField.UpdateItemSource(argument);
                }
                api.CompanyEntity.UserTables = null;
                session.OpenCompany(api.CompanyEntity.CompanyId, false);
            }
        }