Ejemplo n.º 1
0
        private void hlUpdate_Click(object sender, RoutedEventArgs e)
        {
            dynamic d = UserSourceResult.SelectedItem as dynamic;

            if (string.IsNullOrEmpty(d.Name))
            {
                CPApplication.Current.CurrentPage.Context.Window.Alert("渠道名称不能为空!", MessageType.Error);
                return;
            }
            CpsUserVM vm = new CpsUserVM()
            {
                UserSource = new CpsUserSourceVM()
                {
                    ChanlName = d.Name, SysNo = d.SysNo
                }
            };

            facade.UpdateUserSource(vm, (obj, arg) =>
            {
                if (arg.FaultsHandle())
                {
                    return;
                }
                CPApplication.Current.CurrentPage.Context.Window.Alert("更新成功!");
                HyperlinkButton link = (HyperlinkButton)sender;
                setActionStyle(link);
            });
        }
Ejemplo n.º 2
0
        private void BtnOk_Click(object sender, RoutedEventArgs e)
        {
            if (!ValidationManager.Validate(this))
            {
                return;
            }
            CpsUserVM vm = this.DataContext as CpsUserVM;

            vm.SysNo = Data.SysNo;
            vm.BasicUser.WebSiteCode = vm.WebSiteType.SelectValue;
            vm.BasicUser.UserType    = vm.UserType;
            if (string.IsNullOrEmpty(vm.BasicUser.WebSiteCode))
            {
                CPApplication.Current.CurrentPage.Context.Window.Alert("请选择网站类型!", MessageType.Error);
                return;
            }
            facade.UpdateBasicUser(vm, (obj, arg) =>
            {
                if (arg.FaultsHandle())
                {
                    return;
                }
                CPApplication.Current.CurrentPage.Context.Window.Alert("更新成功!");
                CloseDialog(DialogResultType.OK);
            });
        }
Ejemplo n.º 3
0
        private void hlAccount_Click(object sender, RoutedEventArgs e)
        {
            dynamic d = this.CpsUserResult.SelectedItem as dynamic;
            ReceivablesAccountMaintain item = new ReceivablesAccountMaintain();
            CpsUserVM data = new CpsUserVM()
            {
                ReceivablesAccount = new CpsReceivablesAccountVM()
                {
                    BranchBank             = d.BranchBank,
                    BrankCardNumber        = d.BankCardNumber,
                    BrankCode              = d.BankCode,
                    BrankName              = d.BankName,
                    ReceiveablesName       = d.ReceivableName,
                    IsLock                 = d.BankLock,
                    ReceivablesAccountType = d.BankAccountType
                },
                SysNo = d.SysNo
            };

            item.Data   = data;
            item.Dialog = Window.ShowDialog(" 收款账户信息", item, (s, args) =>
            {
                if (args.DialogResult == Newegg.Oversea.Silverlight.Controls.Components.DialogResultType.OK)
                {
                    this.CpsUserResult.Bind();
                }
            });
        }
        private void Btnok_Click(object sender, RoutedEventArgs e)
        {
            if (!ValidationManager.Validate(this))
            {
                return;
            }
            CpsUserVM vm = this.DataContext as CpsUserVM;

            vm.SysNo = Data.SysNo;
            if (vm.ReceivablesAccount.Bank.SelectValue == null)
            {
                CPApplication.Current.CurrentPage.Context.Window.Alert("请选择银行!", MessageType.Error);
                return;
            }
            vm.ReceivablesAccount.BrankCode = vm.ReceivablesAccount.Bank.SelectValue;
            facade.UpdateCpsReceivablesAccount(vm, (obj, arg) =>
            {
                if (arg.FaultsHandle())
                {
                    return;
                }
                CPApplication.Current.CurrentPage.Context.Window.Alert("更新成功!");
                CloseDialog(DialogResultType.OK);
            });
        }
Ejemplo n.º 5
0
        /// <summary>
        /// model转换
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        private CpsUserInfo ConvertInfo(CpsUserVM data)
        {
            CpsUserInfo info = new CpsUserInfo();

            if (data != null)
            {
                if (data.BasicUser != null)
                {
                    info.UserBasicInfo = new CpsBasicUserInfo()
                    {
                        AllianceAccount = data.BasicUser.AllianceAccount,
                        Contact         = data.BasicUser.Contact,
                        ContactAddress  = data.BasicUser.ContactAddress,
                        ContactPhone    = data.BasicUser.ContactPhone,
                        Email           = data.BasicUser.Email,
                        IsActive        = data.BasicUser.IsActive,
                        UserType        = data.BasicUser.UserType,
                        WebSiteAddress  = data.BasicUser.WebSiteAddress,
                        WebSiteCode     = data.BasicUser.WebSiteCode,
                        WebSiteName     = data.BasicUser.WebSiteName,
                        Zipcode         = data.BasicUser.ZipCode
                    };
                }
                if (data.UserSource != null)
                {
                    info.Source = new CpsUserSource()
                    {
                        ChanlName = data.UserSource.ChanlName,
                        Source    = data.UserSource.Source,
                        SysNo     = data.UserSource.SysNo,
                        UserType  = data.UserSource.UserType
                    };
                }
                if (data.ReceivablesAccount != null)
                {
                    info.ReceivablesAccount = new CpsReceivablesAccount()
                    {
                        BranchBank             = data.ReceivablesAccount.BranchBank,
                        BrankCardNumber        = data.ReceivablesAccount.BrankCardNumber,
                        BrankCode              = data.ReceivablesAccount.BrankCode,
                        BrankName              = data.ReceivablesAccount.BrankName,
                        IsLock                 = data.ReceivablesAccount.IsLock,
                        ReceivablesAccountType = data.ReceivablesAccount.ReceivablesAccountType,
                        ReceiveablesName       = data.ReceivablesAccount.ReceiveablesName
                    };
                }
                info.CompanyCode  = CPApplication.Current.CompanyCode;
                info.LanguageCode = CPApplication.Current.LanguageCode;
                info.User         = new BizEntity.Common.UserInfo()
                {
                    SysNo    = CPApplication.Current.LoginUser.UserSysNo,
                    UserName = CPApplication.Current.LoginUser.LoginName
                };
                info.SysNo = data.SysNo;
                info.AuditNoClearanceInfo = data.AuditNoClearanceInfo;
                info.Status = data.Status;
            }
            return(info);
        }
Ejemplo n.º 6
0
 public CpsUserSourceEdit()
 {
     InitializeComponent();
     this.Loaded += (sender, e) =>
     {
         facade = new CpsUserFacade();
         model  = new CpsUserVM()
         {
             UserSource = new CpsUserSourceVM()
             {
                 UserType = UserType
             }
         };
         this.DataContext = model;
     };
 }
Ejemplo n.º 7
0
        private void BtnOK_Click(object sender, RoutedEventArgs e)
        {
            CpsUserVM vm = new CpsUserVM()
            {
                SysNo = SysNo, Status = AuditStatus.AuditNoClearance, AuditNoClearanceInfo = txtInfo.Text
            };

            facade.AuditUser(vm, (obj, arg) =>
            {
                if (arg.FaultsHandle())
                {
                    return;
                }
                CPApplication.Current.CurrentPage.Context.Window.Alert("审核成功!");
                CloseDialog(DialogResultType.OK);
            });
        }
Ejemplo n.º 8
0
        private void hlAuditClearance_Click(object sender, RoutedEventArgs e)
        {
            dynamic   d  = this.CpsUserResult.SelectedItem;
            CpsUserVM vm = new CpsUserVM()
            {
                SysNo = d.SysNo, Status = AuditStatus.AuditClearance
            };

            facade.AuditUser(vm, (obj, arg) =>
            {
                if (arg.FaultsHandle())
                {
                    return;
                }
                Window.MessageBox.Show("审核成功!", MessageBoxType.Success);
                this.CpsUserResult.Bind();
            });
        }
Ejemplo n.º 9
0
        private void BtnOk_Click(object sender, RoutedEventArgs e)
        {
            if (!ValidationManager.Validate(this))
            {
                return;
            }
            CpsUserVM vm = this.DataContext as CpsUserVM;

            vm.SysNo = SysNo;
            facade.CreateUserSource(vm, (obj, arg) =>
            {
                if (arg.FaultsHandle())
                {
                    return;
                }
                CPApplication.Current.CurrentPage.Context.Window.Alert("创建成功!");
                CloseDialog(DialogResultType.OK);
            });
        }
Ejemplo n.º 10
0
        private void hlUserBasic_Click(object sender, RoutedEventArgs e)
        {
            dynamic d = this.CpsUserResult.SelectedItem as dynamic;
            CpsUserBasicMaintain item = new CpsUserBasicMaintain();
            CpsUserVM            data = new CpsUserVM()
            {
                BasicUser = new CpsBasicUserInfoVM()
                {
                    AllianceAccount = d.CustomerID,
                    Contact         = d.ContactName,
                    ContactAddress  = d.ContactAddress,
                    ContactPhone    = d.ContactPhone,
                    Email           = d.Email,
                    IsActive        = d.IsAvailable == null ? IsActive.DeActive : d.IsAvailable,
                    WebSiteAddress  = d.WebSiteUrl,
                    WebSiteCode     = d.WebSiteCode,
                    WebSiteName     = d.WebSiteName,
                    ZipCode         = d.ZipCode
                },
                SysNo = d.SysNo,
            };

            data.ListWebSiteType = model.ListWebSiteType;
            data.WebSiteType     = (from p in data.ListWebSiteType where p.SelectValue == d.WebSiteCode select p).ToList().FirstOrDefault();

            if (data.WebSiteType == null)
            {
                data.WebSiteType = (from p in data.ListWebSiteType where p.SelectValue == null select p).ToList().FirstOrDefault();
            }

            data.UserType = d.UserType;
            item.Data     = data;
            item.Dialog   = Window.ShowDialog("基本信息", item, (s, args) =>
            {
                if (args.DialogResult == Newegg.Oversea.Silverlight.Controls.Components.DialogResultType.OK)
                {
                    this.CpsUserResult.Bind();
                }
            });
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 禁用启用
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void hlActive_Click(object sender, RoutedEventArgs e)
        {
            dynamic         d    = this.CpsUserResult.SelectedItem as dynamic;
            HyperlinkButton link = (HyperlinkButton)sender;
            IsActive        eum  = link.Tag == null ? IsActive.DeActive : (IsActive)link.Tag;
            CpsUserVM       vm   = new CpsUserVM()
            {
                BasicUser = new CpsBasicUserInfoVM()
                {
                    IsActive = eum == IsActive.Active?IsActive.DeActive:IsActive.Active
                },
                SysNo = d.SysNo
            };

            facade.UpdateUserStatus(vm, (obj, arg) =>
            {
                if (arg.FaultsHandle())
                {
                    return;
                }
                Window.MessageBox.Show(string.Format("{0}成功!", link.Content.ToString()), MessageBoxType.Success);
                this.CpsUserResult.Bind();
            });
        }
Ejemplo n.º 12
0
        public void UpdateCpsReceivablesAccount(CpsUserVM vm, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            string UpdateCpsReceivablesAccountUrl = "ExternalSYSService/CpsUser/UpdateCpsReceivablesAccount";

            restClient.Update(UpdateCpsReceivablesAccountUrl, ConvertInfo(vm), callback);
        }
Ejemplo n.º 13
0
        public void UpdateBasicUser(CpsUserVM vm, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            string UpdateBasicUserUrl = "ExternalSYSService/CpsUser/UpdateBasicUser";

            restClient.Update(UpdateBasicUserUrl, ConvertInfo(vm), callback);
        }
Ejemplo n.º 14
0
        public void CreateUserSource(CpsUserVM vm, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            string CreateUserSourceUrl = "ExternalSYSService/CpsUser/CreateUserSource";

            restClient.Create(CreateUserSourceUrl, ConvertInfo(vm), callback);
        }