public static bool IsActiveSuperAccount(string seller, string desc = null) { var isSuperAccount = false; string mainPart = TbNickHelper.GetMainPart(seller); if (seller == mainPart) { isSuperAccount = true; } else { var superAccounts = Auth.GetSuperAccounts(mainPart); var activeNicks = Detected.GetLatest5SecDetectedNicksNotNull(); foreach (var acc in superAccounts) { if (activeNicks.Contains(acc)) { isSuperAccount = true; break; } } } if (!isSuperAccount && !string.IsNullOrEmpty(desc)) { var msg = string.Format("【{0}】没有【{1}】的权限\r\n\r\n需要在电脑上登录【{2}】店铺的主账号或者特权子账号才能{1}!\r\n\r\n是否查看如何设置特权子账号?", seller, desc , mainPart); MsgBox.ShowTip(msg, showHelp => { if (showHelp) { } }, "提示"); } return(isSuperAccount); }
public WndShortcutImporter(string seller) { this.InitializeComponent(); this.Seller = seller; this._sellerMain = TbNickHelper.GetMainPart(seller); if (LocalParams.IsReplace) { this.rbtReplace.IsChecked = new bool?(true); this.rbtAppend.IsChecked = new bool?(false); } else { this.rbtReplace.IsChecked = new bool?(false); this.rbtAppend.IsChecked = new bool?(true); } if (LocalParams.IsPub) { this.rbtPub.IsChecked = new bool?(true); } else { LocalParams.IsPub = false; this.rbtPub.Content = "导入成:全店通用短语(没有权限,需要主号或特权子号)"; this.rbtPub.IsEnabled = false; this.rbtPrv.IsChecked = new bool?(true); } this.SelectFile(null); }
public void InitUI(string seller) { _seller = seller; _sellerMain = TbNickHelper.GetMainPart(seller); cboxCancelAutoOnReset.IsChecked = Params.Robot.CancelAutoOnReset; tboxNoAnswerTip.Text = Params.Robot.GetAutoModeNoAnswerTip(_seller); tboxAutoDelay.Text = Params.Robot.GetAutoModeReplyDelaySec(_seller).ToString(); tboxSendDelay.Text = Params.Robot.GetSendModeReplyDelaySec(_seller).ToString(); cboxAlwaysSend.IsChecked = Params.Robot.GetQuoteModeSendAnswerWhenFullMatch(_seller); cboxKeyExclude.IsChecked = Params.Robot.GetRuleIncludeExcept(_sellerMain); }
public static HashSet <string> ConvertNicksToDbAccount(string[] nicks) { var set = new HashSet <string>(); foreach (var nick in nicks.xSafeForEach()) { set.Add(AccountHelper.GetPubDbAccount(nick)); set.Add(AccountHelper.GetPrvDbAccount(nick)); set.Add(nick); set.Add(TbNickHelper.GetMainPart(nick)); set.Add(AccountHelper.GetShopDbAccount(nick)); } return(set); }
public void InitUI(string seller) { _seller = seller; _sellerMain = TbNickHelper.GetMainPart(seller); tbkTip.Text = string.Format("请输入【{0}】店铺的【特权子账号(权限与主账号一样)】:(输入子账号部分即可,多个账号用逗号分隔)", _sellerMain); var superAccounts = Params.Auth.GetSuperAccounts(_sellerMain); tboxNicks.Text = superAccounts.xToString(" ,"); if (Params.Auth.GetIsAllAccountEditKnowledge(seller)) { rbtKnAll.IsChecked = true; rbtKnSuper.IsChecked = false; } else { rbtKnAll.IsChecked = false; rbtKnSuper.IsChecked = true; } if (Params.Auth.GetIsAllAccountEditRobot(seller)) { rbtRobotAll.IsChecked = true; rbtRobotSuper.IsChecked = false; } else { rbtRobotAll.IsChecked = false; rbtRobotSuper.IsChecked = true; } if (Params.Auth.GetIsAllAccountEditShortCut(seller)) { rbtScAll.IsChecked = true; rbtScSuper.IsChecked = false; } else { rbtScAll.IsChecked = false; rbtScSuper.IsChecked = true; } }
public static bool IsSuperAccount(string seller) { var mainPart = TbNickHelper.GetMainPart(seller); return(mainPart == seller || QnHelper.Auth.GetSuperAccounts(mainPart).Contains(seller)); }
public static string GetMainPart(string seller) { return(TbNickHelper.GetMainPart(seller)); }
private void mExport_Click(object sender, RoutedEventArgs e) { string mainPart = TbNickHelper.GetMainPart(this._seller); TreeDbAccessor pubDbAccessor = (_pubTvController != null) ? _pubTvController.DbAccessor : null; //Exporter.Export(mainPart, pubDbAccessor, (_prvTvController != null) ? _prvTvController.DbAccessor : null); }