/// <summary>
        /// Called when user interacted with session notification
        /// </summary>
        /// <param name="action">The action user has made</param>
        private void NotificationRequest(AppAction action)
        {
            // Fire proper command based on the action
            // So clicking on the notification has the exact same effect as clicking on the page
            switch (action)
            {
            case AppAction.NextSessionTask:
            {
                mSessionHandler.Finish();
            } break;

            case AppAction.PauseSession:
            {
                mSessionHandler.Pause();
            } break;

            case AppAction.ResumeSession:
            {
                mSessionHandler.Resume();
            } break;

            case AppAction.StopSession:
            {
                mSessionHandler.EndSession();
            } break;
            }
        }
Example #2
0
        internal static ShortcutInfo ToShortcutInfo(this AppAction action)
        {
            var context = Application.Context;

            var shortcut = new ShortcutInfo.Builder(context, action.Id)
                           .SetShortLabel(action.Title);

            if (!string.IsNullOrWhiteSpace(action.Subtitle))
            {
                shortcut.SetLongLabel(action.Subtitle);
            }

            if (!string.IsNullOrWhiteSpace(action.Icon))
            {
                var iconResId = context.Resources.GetIdentifier(action.Icon, "drawable", context.PackageName);

                shortcut.SetIcon(Icon.CreateWithResource(context, iconResId));
            }

            var intent = new Intent(AppActionsImplementation.IntentAction);

            intent.SetPackage(context.PackageName);
            intent.SetFlags(ActivityFlags.ClearTop | ActivityFlags.SingleTop);
            intent.PutExtra(extraAppActionId, action.Id);
            intent.PutExtra(extraAppActionTitle, action.Title);
            intent.PutExtra(extraAppActionSubtitle, action.Subtitle);
            intent.PutExtra(extraAppActionIcon, action.Icon);

            shortcut.SetIntent(intent);

            return(shortcut.Build());
        }
Example #3
0
 public Playing(AppDisplay appDisplay, AppAction appAction, string targetFileName)
 {
     InitializeComponent();
     this.appDisplay     = appDisplay;
     this.appAction      = appAction;
     this.targetFileName = targetFileName;
 }
Example #4
0
 static void ProcessCommand(AppAction action)
 {
     if (action != null)
     {
         action();
     }
 }
Example #5
0
 public AppEventArgs(AppAction action, object object1, object object2, object object3)
 {
     Action  = action;
     Object1 = object1;
     Object2 = object2;
     Object3 = object3;
 }
 public ActionDataBuilder CreateFor(ActionContainer actionContainer)
 {
     _actionContainer          = actionContainer;
     _action                   = ObjectCloner.Clone(_cacheService.GetActions().Single(x => x.Id == _actionContainer.AppActionId));
     _containerParameterValues = _actionContainer.ParameterValues ?? "";
     return(this);
 }
Example #7
0
 private void mnuNew_Click(object sender, EventArgs e)
 {
     Action = AppAction.Add;
     InitialiseAction();
     ReturnCode1 = 0;
     flush();
 }
Example #8
0
        /// <summary>
        /// 删除项目
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem10_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (gridView1.SelectedRowsCount == 0)
            {
                XtraMessageBox.Show("请先选择要删除的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            string sa001;
            int    re;

            if (XtraMessageBox.Show("确认要删除吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
            {
                return;
            }

            foreach (int i in gridView1.GetSelectedRows())
            {
                //权限检查
                if (!AppAction.CheckRight("删除销售项目", gridView1.GetRowCellValue(i, "SA100").ToString()))
                {
                    continue;
                }

                sa001 = gridView1.GetRowCellValue(i, "SA001").ToString();
                re    = FireAction.FireBusinessRemove(sa001);
                if (re < 0)
                {
                    return;
                }
            }

            this.RefreshSalesData();
        }
Example #9
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="action"></param>
 /// <param name="current"></param>
 /// <param name="object1"></param>
 /// <param name="object2"></param>
 public AppEventArgs(AppAction action, WorkItem current, object object1, object object2)
 {
     Action = action;
     CurrentWorkItemSelection = current;
     Object1 = object1;
     Object2 = object2;
 }
Example #10
0
        /// <summary>
        /// 本馆火化寄存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (!AppAction.CheckRight("寄存登记"))
            {
                return;
            }

            Frm_fromFire frm_fromFire = new Frm_fromFire();

            frm_fromFire.swapdata["BusinessObject"] = this;
            if (frm_fromFire.ShowDialog() == DialogResult.OK)
            {
                string s_ac001 = this.swapdata["AC001"].ToString();
                frm_fromFire.Dispose();

                Frm_Register regform = new Frm_Register();
                regform.swapdata["dataset"] = register_ds;
                regform.swapdata["source"]  = "0";
                regform.swapdata["AC001"]   = s_ac001;
                if (regform.ShowDialog() == DialogResult.OK)
                {
                    this.RefreshData();
                }
                regform.Dispose();
            }
            frm_fromFire.Dispose();
        }
Example #11
0
        /// <summary>
        /// 寄存时间修正
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem16_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //权限检查
            if (!AppAction.CheckRight("寄存时间修正"))
            {
                return;
            }

            int    rowHandle = gridView1.FocusedRowHandle;
            string s_rc001   = string.Empty;

            if (rowHandle >= 0)
            {
                if (register_ds.Rc01.Rows[gridView1.GetDataSourceRowIndex(rowHandle)]["SOURCE"].ToString() != "2")
                {
                    MessageBox.Show("只有原始寄存可以调整寄存日期!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
                s_rc001 = gridView1.GetRowCellValue(rowHandle, "RC001").ToString();
                if (RegisterAction.GetRegPayRecordNum(s_rc001) > 1)
                {
                    MessageBox.Show("原始登记已经缴费,不能继续!", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
                Frm_AdjustRegisterDate frm_1 = new Frm_AdjustRegisterDate();
                frm_1.swapdata["AC001"] = s_rc001;
                frm_1.ShowDialog();
                frm_1.Dispose();
            }
        }
Example #12
0
        private void barButtonItem19_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //权限检查
            if (!AppAction.CheckRight("设置火化时间"))
            {
                return;
            }

            ////// 检查是否 火化结算完成  //////
            if (FireAction.FireIsSettled(AC001) == "1" && Envior.cur_userId != AppInfo.ROOTID)
            {
                XtraMessageBox.Show("火化业务已经办理并且结算,不能修改!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            Frm_FireTime frm_1 = new Frm_FireTime();

            if (frm_1.ShowDialog() != DialogResult.OK)
            {
                frm_1.Dispose();
                return;
            }
            DateTime dt_fire = Convert.ToDateTime(frm_1.swapdata["AC015"]);

            //XtraMessageBox.Show(dt_fire.ToString("yyyy-MM-dd HH:mm"));
            if (FireAction.SetFireTime(AC001, dt_fire.ToString("yyyy-MM-dd HH:mm")) < 0)
            {
                return;
            }
            txtedit_ac015.EditValue = dt_fire;
            frm_1.Dispose();
        }
Example #13
0
        /// <summary>
        /// 删除登记记录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem3_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int rowHandle = gridView1.FocusedRowHandle;;

            if (rowHandle < 0)
            {
                return;
            }

            if (!AppAction.CheckRight("登记信息修改", gridView1.GetRowCellValue(rowHandle, "AC100").ToString()))
            {
                return;
            }

            string s_ac001 = gridView1.GetRowCellValue(rowHandle, "AC001").ToString();

            if (MessageBox.Show("确认要删除登记信息吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Cancel)
            {
                return;
            }

            if (FireAction.RemoveFireCheckin(s_ac001, Envior.cur_userId) > 0)
            {
                XtraMessageBox.Show("删除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.RefreshData();
            }
        }
Example #14
0
        protected string GetAppActionIconUrl(Guid appID, int actionType)
        {
            FeedTemplate template = FeedBO.Instance.GetFeedTemplate(appID, actionType);

            if (template != null)
            {
                return(template.IconUrl);
            }

            AppBase app = AppManager.GetApp(appID);

            if (app == null)
            {
                return(string.Empty);
            }

            AppAction appAction = app.AppActions.GetValue(actionType);

            if (appAction == null)
            {
                return(string.Empty);
            }

            return(appAction.IconUrl);
        }
Example #15
0
    public static AppAction CreateGameJoined(int playerSlot)
    {
        var action = new AppAction(AppActionType.GameJoined);

        action.playerSlot = playerSlot;
        return(action);
    }
Example #16
0
        /// <summary>
        /// 编辑记录
        /// </summary>
        /// <param name="rowHandle"></param>
        private void Modify(int rowHandle)
        {
            if (rowHandle < 0)
            {
                return;
            }

            string handler = gridView1.GetRowCellValue(rowHandle, "AC100").ToString();

            if (!AppAction.CheckRight("登记信息修改", handler))
            {
                return;
            }

            Frm_fireCheckin frm_ac01 = new Frm_fireCheckin();

            frm_ac01.swapdata["action"]         = "edit";
            frm_ac01.swapdata["dataset"]        = this.checkin_ds;
            frm_ac01.swapdata["businessObject"] = this;

            string s_ac001 = gridView1.GetRowCellValue(rowHandle, "AC001").ToString();

            frm_ac01.swapdata["AC001"] = s_ac001;

            if (frm_ac01.ShowDialog() == DialogResult.OK)
            {
                adapter.SelectCommand.CommandText = "select * from ac01 where ac001='" + s_ac001 + "'";
                adapter.Fill(shadow_dt);
                checkin_ds.Ac01.Merge(this.shadow_dt);
            }
            frm_ac01.Dispose();
            //TODO 3.同步ac01与 rc01
        }
Example #17
0
    public static AppAction CreateReadyAction(int playerId)
    {
        var action = new AppAction(AppActionType.SignIn);

        action.playerId = playerId;
        return(action);
    }
        public override void Up()
        {
            Create.Column("TaxFree").OnTable("OrderTagGroups").AsBoolean().WithDefaultValue(false);
            Create.Column("Added").OnTable("PeriodicConsumptionItems").AsDecimal().WithDefaultValue(0);
            Create.Column("Removed").OnTable("PeriodicConsumptionItems").AsDecimal().WithDefaultValue(0);
            Execute.Sql("Update PeriodicConsumptionItems set Added = Purchase");
            Delete.Column("Purchase").FromTable("PeriodicConsumptionItems");

            var dc = ApplicationContext as DbContext;

            if (dc != null)
            {
                var ticketPayingRule = dc.Set <AppRule>().SingleOrDefault(x => x.Name == "Ticket Paying Rule");
                if (ticketPayingRule != null)
                {
                    ticketPayingRule.Name      = "Ticket Payment Check";
                    ticketPayingRule.EventName = "BeforeTicketClosing";
                    var markTicketAsClosed = new AppAction {
                        ActionType = "MarkTicketAsClosed", Name = Resources.MarkTicketAsClosed, Parameter = ""
                    };
                    dc.Set <AppAction>().Add(markTicketAsClosed);
                    dc.SaveChanges();
                    ticketPayingRule.Actions.Add(new ActionContainer(markTicketAsClosed));
                }
                dc.SaveChanges();
            }
        }
Example #19
0
        protected AppActionCollection GetFiltratedAppActionList(Guid appID)
        {
            AppActionCollection appActions = new AppActionCollection();
            AppBase             app        = AppManager.GetApp(appID);

            foreach (FeedFilter feedFilter in UserFeedFilters)
            {
                if (feedFilter.AppID == appID)
                {
                    if (feedFilter.FilterType == FilterType.FilterApp)
                    {
                        appActions = app.AppActions;
                        break;
                    }
                    else if (feedFilter.FilterType == FilterType.FilterAppAction)
                    {
                        AppAction appAction = app.AppActions.GetValue(feedFilter.ActionType.Value);
                        if (appAction != null)
                        {
                            appActions.Add(appAction);
                        }
                    }
                }
            }

            return(appActions);
        }
Example #20
0
        /// <summary>
        /// 业务项目编辑
        /// </summary>
        /// <param name="rowIndex"></param>
        private void SalesEdit(int rowIndex)
        {
            if (gridView1.GetRowCellValue(rowIndex, "SA008").ToString() == "1")
            {
                XtraMessageBox.Show("结算完成的记录不能修改!", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            //权限检查
            if (!AppAction.CheckRight("修改销售项目", gridView1.GetRowCellValue(rowIndex, "SA100").ToString()))
            {
                return;
            }

            string        sa001    = gridView1.GetRowCellValue(rowIndex, "SA001").ToString();
            int           index    = gridView1.GetDataSourceRowIndex(rowIndex);
            Frm_salesEdit frm_edit = new Frm_salesEdit();

            frm_edit.swapdata["DATAROW"] = business_ds.Sa01.Rows[index];

            if (frm_edit.ShowDialog() == DialogResult.OK)
            {
                this.RefreshSalesData();
            }
        }
Example #21
0
        public static string FromEnum(AppAction e)
        {
            switch (e)
            {
            case AppAction.DoNothing:
                return(ACTION_SHOW);

            case AppAction.TimeOut:
                return(ACTION_TIMEOUT);

            case AppAction.GoToSession:
                return(ACTION_GOSESSION);

            case AppAction.NextSessionTask:
                return(ACTION_NEXTTASK);

            case AppAction.PauseSession:
                return(ACTION_PAUSETASK);

            case AppAction.ResumeSession:
                return(ACTION_RESUMETASK);

            case AppAction.StopSession:
                return(ACTION_STOP);
            }
            return(ACTION_NOTHING);
        }
Example #22
0
        public AppToolStripButton(AppAction action)
        {
            _action = action;

            switch (action)
            {
            case AppAction.FileNew:
                this.ToolTipText = Global.Languages["Menu/File"]["New..."];
                this.Image       = global::Gordago.FO.Properties.Resources.ProjectNew;
                break;

            case AppAction.FileOpen:
                this.ToolTipText = Global.Languages["Menu/File"]["Open"];
                this.Image       = global::Gordago.FO.Properties.Resources.Open;
                break;

            case AppAction.FileSave:
                this.ToolTipText = Global.Languages["Menu/File"]["Save"];
                this.Image       = global::Gordago.FO.Properties.Resources.Save;
                break;

            case AppAction.FileSaveAll:
                this.ToolTipText = Global.Languages["Menu/File"]["Save All"];
                this.Image       = global::Gordago.FO.Properties.Resources.SaveAll;
                break;
            }
        }
Example #23
0
 public Playing(AppDisplay appDisplay, AppAction appAction, string targetFileName)
 {
     InitializeComponent();
     this.appDisplay = appDisplay;
     this.appAction = appAction;
     this.targetFileName = targetFileName;
 }
Example #24
0
        public override void Up()
        {
            var dc = ApplicationContext as DbContext;

            var closeTicketAutomation = new AutomationCommand {
                Name = Resources.CloseTicket, ButtonHeader = Resources.Close, SortOrder = -1, Color = "#FFFF0000", FontSize = 40
            };

            closeTicketAutomation.AutomationCommandMaps.Add(new AutomationCommandMap {
                EnabledStates = string.Format("{0},{1},{2},{3},IsClosed", Resources.New, Resources.NewOrders, Resources.Unpaid, Resources.Locked), VisibleStates = "*", DisplayUnderTicket = true
            });
            dc.Set <AutomationCommand>().Add(closeTicketAutomation);

            var settleAutomation = new AutomationCommand {
                Name = Resources.Settle, ButtonHeader = Resources.Settle, SortOrder = -2, FontSize = 40
            };

            settleAutomation.AutomationCommandMaps.Add(new AutomationCommandMap {
                EnabledStates = "*", VisibleStates = "*", DisplayUnderTicket = true
            });
            dc.Set <AutomationCommand>().Add(settleAutomation);

            dc.SaveChanges();

            var displayPaymentScreenAction = new AppAction {
                ActionType = ActionNames.DisplayPaymentScreen, Name = Resources.DisplayPaymentScreen, Parameter = "", SortOrder = -1
            };

            dc.Set <AppAction>().Add(displayPaymentScreenAction);

            var closeTicketAction = dc.Set <AppAction>().FirstOrDefault(x => x.ActionType == ActionNames.CloseActiveTicket);

            if (closeTicketAction == null)
            {
                closeTicketAction = new AppAction {
                    ActionType = ActionNames.CloseActiveTicket, Name = Resources.CloseTicket, Parameter = "", SortOrder = -1
                };
                dc.Set <AppAction>().Add(closeTicketAction);
            }
            dc.SaveChanges();

            var closeTicketRule = new AppRule {
                Name = string.Format(Resources.Rule_f, Resources.CloseTicket), EventName = "AutomationCommandExecuted", EventConstraints = "AutomationCommandName;=;" + Resources.CloseTicket, SortOrder = -1
            };

            closeTicketRule.Actions.Add(new ActionContainer(closeTicketAction));
            closeTicketRule.AddRuleMap();
            dc.Set <AppRule>().Add(closeTicketRule);

            var settleTicketRule = new AppRule {
                Name = string.Format(Resources.Rule_f, Resources.Settle), EventName = "AutomationCommandExecuted", EventConstraints = "AutomationCommandName;=;" + Resources.Settle, SortOrder = -1
            };

            settleTicketRule.Actions.Add(new ActionContainer(displayPaymentScreenAction));
            settleTicketRule.AddRuleMap();
            dc.Set <AppRule>().Add(settleTicketRule);

            dc.SaveChanges();
        }
Example #25
0
 private void barButtonItem28_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (!AppAction.CheckRight("寄存量统计"))
     {
         return;
     }
     openBusinessObject("Report_regstat");
 }
Example #26
0
 public static void Publish_AppAction(AppAction appAction, object payload = null, bool force = false)
 {
     if (!force && !CanPublishAppAction)
     {
         return;
     }
     Evt_OnAppActionPublished?.Fire(appAction, payload);
 }
Example #27
0
 private MenuItem GetMenuItem(AppAction action)
 {
     using (var ctx = new AppDbContext())
     {
         IQueryable <MenuItem> dbSet = ctx.MenuItems;
         return(dbSet.AsEnumerable().Where(m => m.AppActionToTake == action).ToArray()[0]);
     }
 }
Example #28
0
 private void barButtonItem20_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (!AppAction.CheckRight("收款作废查询"))
     {
         return;
     }
     openBusinessObject("Report_FinRollBack");
 }
Example #29
0
 /// <summary>
 /// 迁出数据查询
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void barButtonItem13_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (!AppAction.CheckRight("寄存迁出查询"))
     {
         return;
     }
     openBusinessObject("Report_RegisterOut");
 }
Example #30
0
 private void barButtonItem19_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (!AppAction.CheckRight("收款员收款统计"))
     {
         return;
     }
     openBusinessObject("Report_CasherStat");
 }
Example #31
0
 private void barButtonItem11_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (!AppAction.CheckRight("寄存室数据"))
     {
         return;
     }
     openBusinessObject("RegisterRoomData");
 }
Example #32
0
 /// <summary>
 /// 套餐维护
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void barButtonItem31_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (!AppAction.CheckRight("套餐维护"))
     {
         return;
     }
     openBusinessObject("Combo");
 }