Example #1
0
 // TODO: Implement
 public void SetAPI(BaseAPI api)
 {
     throw new NotImplementedException();
 }
Example #2
0
 public CrmFollowUpPage(BaseAPI API)
     : base(API, string.Empty)
 {
     InitPage(null);
 }
Example #3
0
 public void SetAPI(BaseAPI api)
 {
     _crudApi    = new CrudAPI(api);
     _postingAPI = new PostingAPI(api);
 }
 public DebtorOrders(BaseAPI api, string lookupKey)
     : base(api, lookupKey)
 {
     Init(null);
 }
Example #5
0
 public DebtorOffers(BaseAPI API) : base(API, string.Empty)
 {
     Init(null);
 }
 public SalesRepCustomerStatPage(BaseAPI API) : base(API, string.Empty)
 {
     InitPage(null);
 }
Example #7
0
 public ProjectJournalPage(BaseAPI API) : this(API, string.Empty)
 {
 }
Example #8
0
 public InvPurchaseAccountPage(BaseAPI api) : base(api, string.Empty)
 {
     InitializeComponent();
     InitPage(null);
 }
Example #9
0
 public DocsSendLogGridPage(BaseAPI Api) : base(Api, string.Empty)
 {
     InitPage();
 }
 public void SetAPI(BaseAPI api)
 {
     crudApi = api as CrudAPI;
 }
Example #11
0
 public ProductionOrdersPage(BaseAPI API) : base(API, string.Empty)
 {
     Init(null);
 }
Example #12
0
        //
        // GET: /WeiXin/

        /// <summary>
        /// 自行扩展微信交互回调模式逻辑
        /// </summary>
        /// <param name="messageAPI"></param>
        /// <param name="wxHelper"></param>
        /// <returns></returns>
        public override ContentResult ReciveMessage(MessageAPI messageAPI, WeiXinHelper wxHelper)
        {
            var result = new ContentResult();

            #region 接收到的消息类型处理

            BaseAPI.Log(messageAPI.Message.Element("MsgType").Value);

            switch (messageAPI.Message.Element("MsgType").Value)
            {
            case ReceiveMsgType.Text:

                var userID = messageAPI.Message.Element("FromUserName").Value;

                var user = new UserAPI().GetUser(userID);

                result = wxHelper.ReplyImage("系统不会回复你的", "你以为它会回复你", user.Avatar, "http://www.ysyswenli.net");

                break;

            case ReceiveMsgType.Image:

                BaseAPI.Log("黄图哥,这张图片不错!");

                result = wxHelper.ReplyTXT("黄图哥,这张图片不错!");

                break;

            case ReceiveMsgType.Thumb:

                break;

            case ReceiveMsgType.Link:

                break;

            case ReceiveMsgType.Location:

                break;

            case ReceiveMsgType.Voice:

                break;

            case ReceiveMsgType.Music:

                break;

            case ReceiveMsgType.Video:

                break;

            case ReceiveMsgType.News:

                break;

            case ReceiveMsgType.Event:

                #region 事件类型处理

                switch (messageAPI.Message.Element("Event").Value)
                {
                case ReceiveMsgType.EventType.SubscribeEvent:

                    result = wxHelper.ReplyTXT("欢迎您!" + messageAPI.Message.Element("FromUserName").Value);

                    break;

                case ReceiveMsgType.EventType.EnterAgentEvent:

                    result = wxHelper.ReplyTXT("欢迎您!" + messageAPI.Message.Element("FromUserName").Value);

                    break;

                case ReceiveMsgType.EventType.UnSubscribeEvent:

                    break;

                case ReceiveMsgType.EventType.ScanEvent:

                    break;

                case ReceiveMsgType.EventType.ClickEvent:         //微信自定义EventKey
                    if (messageAPI.Message.Element("EventKey").Value == "Photo")
                    {
                        result = wxHelper.ReplyImage("test", "test", "http://wx.qlogo.cn/mmhead/Q3auHgzwzM7G71S7KIpSKIhvsnZoTsEw1qbMySdHZJH6rLYUmNKLFw/0", "http://www.ysyswenli.net");
                    }
                    break;

                case ReceiveMsgType.EventType.ViewEvent:

                    break;

                case ReceiveMsgType.EventType.LocationEvent:

                    break;

                case ReceiveMsgType.EventType.PicSysPhotoEvent:
                    result = wxHelper.ReplyImage("test", "test", "http://wx.qlogo.cn/mmhead/Q3auHgzwzM7G71S7KIpSKIhvsnZoTsEw1qbMySdHZJH6rLYUmNKLFw/0", "http://www.ysyswenli.net");
                    break;

                default:

                    break;
                }
                #endregion
                break;
            }
            #endregion
            return(result);
        }
Example #13
0
        private void OnMainCommand()
        {
            IsShowErrorMessage = false;
            try
            {
                switch (Mode)
                {
                case RollInfoViewModelMode.OpenShift:
                    _rollInfo = BaseAPI.activateTicketRoll(FirstTicketSeries, FirstTicketNumber, RollColor.Default);
                    ApplicationStaticHelper.IsCurrentRollDeactivated = false;
                    _shift = BaseAPI.isShiftOpen() ? BaseAPI.getCurrentShift() : BaseAPI.openShift();
                    break;

                case RollInfoViewModelMode.CloseShift:
                    if (!DeactivateRoll())
                    {
                        return;
                    }
                    if (BaseAPI.isShiftOpen())
                    {
                        BaseAPI.closeShift(BaseAPI.getCurrentShift());
                        ApplicationStaticHelper.ShiftCloseDate = DateTime.Now;
                    }

                    if (BaseAPI.isShiftOpen())
                    {
                        ErrorMessage = "Закрыть смену ({0} {1}) не получилось! Режим {2}.".F(BaseAPI.getCurrentShift().CashierName, BaseAPI.getCurrentShift().OpenDate, Mode);
                        Log.Warn(ErrorMessage);
                        IsShowErrorMessage = true;
                        return;
                    }

                    _rollInfo = null;
                    _shift    = null;
                    break;

                case RollInfoViewModelMode.NeedNewRoll:
                    if (!CloseRoll())
                    {
                        return;
                    }
                    _rollInfo = BaseAPI.activateTicketRoll(FirstTicketSeries, FirstTicketNumber, RollColor.Default);
                    ApplicationStaticHelper.IsCurrentRollDeactivated = false;
                    _shift = BaseAPI.getCurrentShift();
                    break;

                case RollInfoViewModelMode.ChangeRoll:
                    if (!DeactivateRoll())
                    {
                        return;
                    }
                    _rollInfo = BaseAPI.activateTicketRoll(FirstTicketSeries, FirstTicketNumber, RollColor.Default);
                    ApplicationStaticHelper.IsCurrentRollDeactivated = false;
                    _shift = BaseAPI.getCurrentShift();
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
            catch (Exception e)
            {
                Log.Debug("{0} Вызвало исключение:", Mode);
                Log.Fatal(e);
                //throw;

                ErrorMessage       = "Произошло исключение: {0}".F(e.Message);
                IsShowErrorMessage = true;
                return;
            }

            if (_rollInfo.IsNull() && Mode != RollInfoViewModelMode.CloseShift /*&& Mode != RollInfoViewModelMode.ChangeRollDeactivate*/)
            {
                ErrorMessage = String.Format("Бабина с параметрами {0} {1} не существует! Режим {2}.", FirstTicketSeries, FirstTicketNumber, Mode);
                Log.Warn(ErrorMessage);
                IsShowErrorMessage = true;
                return;
            }

            if (_shift.IsNull() && Mode != RollInfoViewModelMode.CloseShift)
            {
                ErrorMessage = String.Format("Смена не определена!");
                Log.Warn(ErrorMessage);
                IsShowErrorMessage = true;
                return;
            }

            Close();
            Dispose();
        }
Example #14
0
 public ProjectTransactionPage(BaseAPI API) : base(API, string.Empty)
 {
     InitializePage(null);
 }
Example #15
0
 public VendorPriceListPage(BaseAPI API) : base(API, string.Empty)
 {
     Init();
 }
 public DebtCollection(BaseAPI API) : base(API, string.Empty)
 {
     InitPage();
 }
Example #17
0
 public VendorPriceListPage(BaseAPI api, string lookupKey)
     : base(api, lookupKey)
 {
     Init();
 }
Example #18
0
 public DebtorInvoiceLinesPage(BaseAPI API) : base(API, string.Empty)
 {
     InitPage(null);
 }
 public UserLayoutPage(BaseAPI API) : base(API, string.Empty)
 {
     Init();
 }
Example #20
0
 public SubscriptionInvoiceLinePage(BaseAPI API)
     : base(API, string.Empty)
 {
     InitPage(null);
 }
 public BankStGLTransPage(BaseAPI API)
     : base(API, string.Empty)
 {
     Init();
 }
Example #22
0
 public ProjectPage(BaseAPI api, string lookupKey)
     : base(api, lookupKey)
 {
     Init();
 }
 public DebtorOrderLineReport(BaseAPI API) : base(API, string.Empty)
 {
     InitializeComponent();
     InitPage();
 }
Example #24
0
 public ProjectPage(BaseAPI API) : base(API, string.Empty)
 {
     Init();
 }
Example #25
0
 public AddUserFields(BaseAPI API) : base(API, string.Empty)
 {
     InitPage();
 }
Example #26
0
 public InvStorageProfileReport(BaseAPI API) : base(API, string.Empty)
 {
     InitPage(null);
 }
Example #27
0
 public QuickInvoice(BaseAPI API)
     : base(API, string.Empty)
 {
     InitializeComponent();
     InitPage();
 }
 public CreditorStatement(BaseAPI API)
     : base(API, string.Empty)
 {
     Init();
 }
 public ProjectTransBudgetPivotPage(BaseAPI API) : base(API, string.Empty)
 {
     Init(null);
 }
Example #30
0
 public DebtorPayments(BaseAPI api, string lookupKey)
     : base(api, lookupKey)
 {
     InitPage();
 }