public void SetCommissionRatio(int type)
 {
     if (CurOrgInfo != null)
     {
         CommissionRatioSet ratio = new CommissionRatioSet();
         bool isSystem = false;
         if (type == 2)
             isSystem = true;
         ErrType err = _tradeService.GetCommissionRatio(_loginID, CurOrgInfo.OrgID, ref  ratio, isSystem);
         if (err.Err != ERR.SUCCESS)
         {
             MessageBox.Show("获取会员返佣比例出错", "提示信息", MessageBoxButton.OK, MessageBoxImage.Error);
         }
         else
         {
             SetCommissionRatioWindow win = new SetCommissionRatioWindow()
             {
                 Owner = Application.Current.MainWindow,
                 Ratio1=ratio.Ratio1,
                 Ratio2=ratio.Ratio2,
                 Ratio3=ratio.Ratio3,
                 DataContext = this
             };
             List<string> orgIDList = new List<string>();
             if (win.ShowDialog() == true)
             {
                 if (type == 1)//当前项
                 {
                     orgIDList.Add(CurOrgInfo.OrgID);
                 }
                 else if (type == 2)//默认
                 {
                     orgIDList.Add("system");
                 }
                 else//批量
                 {
                    
                     foreach (OrgInfo org in OrgList)
                     {
                         if (org.IsCheck == true)
                             orgIDList.Add(org.OrgID);
                     }
                     if(orgIDList.Count==0)
                         orgIDList.Add(CurOrgInfo.OrgID);
                 }
                 ErrType err2 = _tradeService.SetCommissionRatio(_loginID, win.Ratio1, win.Ratio2, win.Ratio3, orgIDList);
                 if (err2.Err != ERR.SUCCESS)
                     MessageBox.Show("设置返佣比例出错!", "提示信息", MessageBoxButton.OK, MessageBoxImage.Information);
             }
         }
     }
    
 }
 /// <summary>
 /// 获取会员返佣比例
 /// </summary>
 /// <param name="loginId">登录ID</param>
 /// <param name="orgID">微会员ID</param>
 /// <param name="url">输出Url</param>
 /// <returns>ErrType</returns>
 public ErrType GetCommissionRatio(string loginId, string orgID,ref CommissionRatioSet ratio,bool type)
 {
     try
     {
         CommissionRatioSetInfo info = TradeService.GetCommissionRatio(loginId, orgID,type);
         ratio.ID = info.ID;
         ratio.OrgID = info.OrgID;
         ratio.Ratio1 = info.Ratio1;
         ratio.Ratio2 = info.Ratio2;
         ratio.Ratio3 = info.Ratio3;
         return info.Result ? GeneralErr.Success : new ErrType(ERR.ERROR, info.Desc);
     }
     catch (Exception ex)
     {
         FileLog.WriteLog("", Assembly.GetExecutingAssembly().GetName().Name, this.GetType().Name, new StackTrace().GetFrame(0).GetMethod().Name, ex.Message);
         return new ErrType(ERR.ERROR, "加载异常!");
     }
 }