예제 #1
0
        /// <summary>
        /// Initializes and invokes the Add Custom Product view.
        /// </summary>
        /// <param name="form">The Sales Order Products form.</param>
        /// <param name="args">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        public static void btnAddCustomProduct_OnClickStep(ISalesOrderProducts form, EventArgs args)
        {
            ISalesOrder salesOrder = form.CurrentEntity as ISalesOrder;

            if (salesOrder != null)
            {
                IWebDialogService dialogService = form.Services.Get <IWebDialogService>();
                if (dialogService != null)
                {
                    string dialogCaption = String.Format(form.GetResource("btnAddCustomProduct.Caption").ToString(),
                                                         salesOrder.SalesOrderNumber);
                    if (salesOrder.IsContractIntegrationEnabled())
                    {
                        dialogService.SetSpecs(20, 20, 390, 700, "ICEditSalesOrderItem", dialogCaption, true);
                    }
                    else
                    {
                        dialogService.SetSpecs(20, 20, 325, 700, "EditSalesOrderItem", dialogCaption, true);
                    }
                    dialogService.DialogParameters.Add("CustomProductSalesOrder", salesOrder);
                    dialogService.EntityType = typeof(ISalesOrderItem);
                    dialogService.ShowDialog();
                }
            }
        }
예제 #2
0
        public static void lueAddUser_OnChangeStep(IOthersAccessToUserCal form, EventArgs args)
        {
            IUser user = form.CurrentEntity as IUser;
            IUser userwantingaccess = form.lueAddUser.LookupResultValue as IUser;

            if (!user.UserCalendarExists(userwantingaccess))
            {
                user.AddUserCalendar(userwantingaccess);

                IWebDialogService dialogService = form.Services.Get <IWebDialogService>();
                dialogService.SetSpecs(235, 420, "EditCalPermissions");
                dialogService.EntityType        = typeof(IUserCalendar);
                dialogService.CompositeKeyNames = "UserId, CalUserId";
                dialogService.EntityID          = string.Format("{0},{1}", userwantingaccess.Id, user.Id);
                dialogService.ShowDialog();
            }
        }
    /// <summary>
    /// Handles the Click event of the hEditAct control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void hEditAct_Click(object sender, EventArgs e)
    {
        string activityID = hActId.Value;

        if (activityID.Length > 12)
        {
            activityID = activityID.Substring(0, 12);
        }
        Activity activity = EntityFactory.GetById <Activity>(activityID);

        if (activity != null)
        {
            if (activity.Recurring && activity.RecurrencePattern.Range.NumOccurences > -1)
            {
                IWebDialogService dialogService = GetdialogService();
                if (dialogService != null)
                {
                    dialogService.SetSpecs(200, 200, 250, 330, "EditRecurrence", "", true);
                    dialogService.EntityType = typeof(IActivity);
                    dialogService.EntityID   = activityID;
                    dialogService.DialogParameters.Add("recurdate", hOccurrenceDate.Value);
                    var appContext = ApplicationContext.Current.Services.Get <IContextService>();
                    if (appContext != null)
                    {
                        var actParams = new Dictionary <string, string>();
                        actParams.Add("recurdate", hOccurrenceDate.Value);
                        appContext["ActivityParameters"] = actParams;
                    }
                    dialogService.ShowDialog();
                }
                else
                {
                    Link.EditActivity(activityID);
                }
            }
            else
            {
                Link.EditActivity(activityID);
            }
        }
    }