Exemple #1
0
 protected void ReloadDealInfos(DealInfoDealType deal_type, crmContractDeal deal, DealInfoNomType nom_type, crmObligationUnit unit, IList <crmObligation> items)
 {
     foreach (crmObligation obl in items)
     {
         var deal_info = _DealInfos.FirstOrDefault(
             x => x.Deal == deal &&
             x.DealType == deal_type &&
             x.NomType == nom_type &&
             x.Order == obl.Order &&
             x.Valuta == obl.Valuta &&
             x.Date == unit.DatePlane
             );
         if (deal_info == null)
         {
             deal_info = new DealInfo(this.Session)
             {
                 DealType = deal_type,
                 Deal     = deal,
                 NomType  = nom_type,
                 Subject  = obl.Order != null ? obl.Order.Subject : null,
                 Order    = obl.Order,
                 Valuta   = obl.Valuta,
                 Date     = unit.DatePlane
             };
             _DealInfos.Add(deal_info);
         }
         deal_info.SummCost += obl.SummCost;
         deal_info.SummVat  += obl.SummNDS;
         deal_info.SummFull += obl.SummFull;
     }
 }
        public bool UpdatePreview(DealInfo info)
        {
            Controls.Clear();

            if (info.IsEmpty())
            {
                Title.Text = @"No Deal with that ID exists";
                SetColumnSpan(Title, 2);
                Controls.Add(Title);
                Title.Width = Title.Parent.Width;
                return(false);
            }
            Title.Text       = info.Name;
            ID.Text          = info.RecordNumber;
            DealDate.Text    = String.Format("{0:M-d-yyyy}", info.DealDate);
            LastUpdated.Text = String.Format("{0:M-d-yyyy}", info.LastUpdated);

            SetColumnSpan(Title, 2);
            Controls.Add(Title);
            Title.Width  = Title.Parent.Width;
            Title.Height = Title.Parent.Height;
            Controls.Add(IDLabel);
            Controls.Add(ID);
            Controls.Add(DealDateLabel);
            Controls.Add(DealDate);
            Controls.Add(LastUpdatedLabel);
            Controls.Add(LastUpdated);
            return(true);
        }
 public void StartNewDeal(DealInfo dealInfo)
 {
     this.hand.Clear();
     this.Contract = new Contract();
     this.Deal     = dealInfo;
     this.Draw();
 }
Exemple #4
0
    public void RepayLoan(DealInfo TargetLoan, int Balance)
    {
        TargetLoan.LoanValue = Balance;

        string TargetEconomyHistory = TargetLoan.ServiceBank.Name + " Loan Interest";

        TargetLoan.CostomerValue.GetEconomyValue().GetComponent <EconomyValue>().ModifyPersistHistory(TargetEconomyHistory, -1, TimeManagerCall.Month, "Loan", "Loan Interest", TargetEconomyHistory, -Mathf.CeilToInt(TargetLoan.InterestRate * TargetLoan.LoanValue));
    }
Exemple #5
0
 private void uxRetrieveInformation_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(uxDealNumber.Text))
     {
         DealInfo dealInfo = SitecoreClient.GetDealInfo(uxDealNumber.Text);
         uxPreviewDeals.UpdatePreview(dealInfo);
         uxPreviewDeals.Tag            = dealInfo;
         uxRetrieveInformation.Visible = false;
         uxInsertIntoArticle.Visible   = true;
         uxViewDetails.Enabled         = true;
     }
 }
Exemple #6
0
    public DealInfo StartNewDeal(CompanyValue TargetCompanyValue, string BankName, int LoanValue)
    {
        DealInfo NewDeal = new DealInfo();

        NewDeal.CostomerValue = TargetCompanyValue;
        NewDeal.ServiceBank   = GetBankInfo(BankName);
        NewDeal.LoanValue     = LoanValue;
        NewDeal.InterestRate  = EvaluateCostomer(BankName, NewDeal.CostomerValue)[0];
        NewDeal.StartDate     = TimeManagerCall.TimeValue;

        NewDeal.ServiceBank.DealList.Add(NewDeal);
        NewDeal.CostomerValue.GetEconomyValue().GetComponent <EconomyValue>().AddPersistHistory(TimeManagerCall.GetNextMonth(0) + (NewDeal.StartDate % TimeManagerCall.Month), TimeManagerCall.Month, "Upkeep", "Loan Interest", BankName + " Loan Interest", -Mathf.CeilToInt(NewDeal.InterestRate * NewDeal.LoanValue));
        NewDeal.CostomerValue.GetEconomyValue().GetComponent <EconomyValue>().AddHistory(TimeManagerCall.TimeValue, "Loan", "Loan Money", BankName + " Loan Money", LoanValue);

        return(NewDeal);
    }
Exemple #7
0
 /// <summary>
 /// Execute the next step. If a deal number is in the preview, insert it and remove from preview.
 /// If no deal is in the preview, try place it in preview.
 /// </summary>
 public void DealNumberGo()
 {
     companyTreeView1.Visible = false;
     uxPreviewDeals.Visible   = true;
     if (uxPreviewDeals.Tag == null)
     {
         DealInfo dealInfo = SitecoreClient.GetDealInfo(uxDealNumber.Text);
         uxPreviewDeals.UpdatePreview(dealInfo);
         uxPreviewDeals.Tag            = dealInfo;
         uxRetrieveInformation.Visible = false;
         uxInsertIntoArticle.Visible   = true;
         uxViewDetails.Enabled         = true;
     }
     else if (uxPreviewDeals.Tag is DealInfo)
     {
         InsertDealIntoDocument((DealInfo)uxPreviewDeals.Tag);
         SetToRetrieveDealMode();
     }
 }
Exemple #8
0
        public DealInfo toDTO(DBDeals deal)
        {
            DealInfo result = new DealInfo();

            //result.ClosePrice = deal;
            if (deal.Closetime.HasValue)
            {
                result.CloseTime = deal.Closetime.Value.ToString(xtradeConstants.MTDATETIMEFORMAT);
            }
            result.Comment    = deal.Comment;
            result.Commission = (double)deal.Commission;
            result.Lots       = (double)deal.Volume;
            if (deal.Adviser != null)
            {
                result.Magic = deal.Adviser.Id;
            }

            result.OpenPrice = (double)deal.Price;
            result.OpenTime  = deal.Opentime.ToString(xtradeConstants.MTDATETIMEFORMAT);
            result.Profit    = (double)deal.Profit;
            if (deal.Terminal != null)
            {
                result.Account     = deal.Terminal.Accountnumber.Value;
                result.AccountName = deal.Terminal.Broker;
            }

            result.SwapValue = (double)deal.Swap;
            if (deal.Symbol != null)
            {
                result.Symbol = deal.Symbol.Name;
            }
            if (deal.Orderid.HasValue)
            {
                result.Ticket = deal.Orderid.Value;
            }
            result.Type = (sbyte)deal.Typ;
            return(result);
        }
Exemple #9
0
        private static void LoadAccontDetail(string pageData, AccountInfo ac)
        {
            // <td valign="top" width="20%">
            //         <DIV noWrap><a href="/?act=portfolio&xid=616"><B>BoostErr</B></a></DIV>
            //         <DIV noWrap><FONT color=#006600><a href="/?act=broker&id=114"><FONT color=#006600>Alpari-Micro</FONT></a></FONT></DIV>
            // <DIV noWrap><FONT color=#6a5acd><B><span style="color:red">Real</span></B> | USD</FONT></DIV>
            //         <DIV noWrap><B>204677</B></DIV>
            //         <DIV noWrap><B>*****</B></DIV>
            //         <DIV noWrap><B>08/10/2007</B>. &nbsp;days: <B>863</B></DIV>
            //         <DIV noWrap><B>08/10/2007</B>. &nbsp;days: <B>863</B></DIV>
            //         <DIV noWrap><B>16/02/2010</B>. &nbsp;days: <B>1</B></DIV>
            //         <DIV noWrap><FONT color=#339966><B>300.00</B></FONT></DIV>
            //         <DIV noWrap><B>1055</B></DIV>
            //</td>

            //<a href="/\?act=portfolio&xid=\d+"><B>
            //var trader = GetStringBetween("<a href=\"/\\?act=portfolio&xid=\\d+\"><B>", "</B>", pageData);
            //var broker = GetStringBetween("<a href=\"/\\?act=broker&id=\\d+\"><FONT color=#\\d+>", "</FONT>", pageData);
            //var login = GetStringBetween("<DIV noWrap><B>", "</B>", pageData);
            var depo = GetStringBetween("<DIV noWrap><FONT color=#339966><B>", "</B>", pageData);

            ac.InitBalance = DealInfo.ParseDecimalSafe(depo);
        }
Exemple #10
0
        public ActionResult CreateDeal(string TreasureUID = "")
        {
            //根据id生成对象的GUID
            Guid TreasureGuid = Guid.Parse(TreasureUID);

            if (!string.IsNullOrEmpty(TreasureUID))
            {
                //获取当前选择物品的所属人
                string holderid = repository.Treasures
                                  .Where(t => t.TreasureUID == TreasureGuid)
                                  .FirstOrDefault().HolderID;

                if (!string.IsNullOrEmpty(holderid))
                {
                    //当前登录用户所有的物品
                    var userTrea = repository.Treasures.Where(t => t.HolderID == CurrentUser.Id);

                    //生成对应视图模型
                    DealInfo dealInfo = new DealInfo
                    {
                        //当前物品的所属人对象
                        Holder = UserManager.FindById(holderid),
                        //当前物品对象
                        DealTreasure = repository.Treasures.Where(t => t.TreasureUID == TreasureGuid).FirstOrDefault(),
                        //交易-当前登录用户物品集合-模型
                        DealMyTreasureModel = new DealMyTreasureModel
                        {
                            DealTreasureGuid = TreasureGuid,
                            UserTreasures    = userTrea
                        }
                    };
                    return(View(dealInfo));
                }
            }
            return(View());
        }
        public ActionResult UploadFile(SalesDataModel salesDataModel)
        {
            if (salesDataModel == null || salesDataModel.SalesFile == null)
            {
                if (HttpContext?.Application?.Get("SalesFile") != null)
                {
                    ModelState.Clear();
                    salesDataModel = (SalesDataModel)HttpContext.Application.Get("SalesFile");
                    if (salesDataModel.deals.Count > 0)
                    {
                        return(View("View", salesDataModel));
                    }
                }
                else
                {
                    salesDataModel           = new SalesDataModel();
                    salesDataModel.SalesFile = null;
                    return(View("View", salesDataModel));
                }
            }
            else if (HttpContext != null)
            {
                HttpContext.Application.Clear();
                HttpContext.Application.Add("SalesFile", salesDataModel);
            }

            try
            {
                if (ModelState.IsValid)
                {
                    StreamReader reader = new StreamReader(salesDataModel.SalesFile.InputStream, Encoding.Default);

                    string csvFormat = "DealNumber,CustomerName,DealershipName,Vehicle,Price,Date";
                    string line      = reader.ReadLine();
                    if (line == csvFormat)
                    {
                        while (!reader.EndOfStream)
                        {
                            line = reader.ReadLine();
                            DealInfo dealInfo = new DealInfo(line);
                            if (dealInfo.IsValid)
                            {
                                salesDataModel.deals.Add(dealInfo);
                            }
                            else
                            {
                                salesDataModel.Message = "'" + salesDataModel.SalesFileName + "' file has incorrect data.";
                                salesDataModel.IsValid = false;
                                return(View("View", salesDataModel));
                            }
                        }
                        salesDataModel.Message = "'" + salesDataModel.SalesFileName + "' file details are below";
                        salesDataModel.IsValid = true;
                    }
                    else
                    {
                        salesDataModel.Message = "'" + salesDataModel.SalesFileName + "' file has incorrect data. ";
                        salesDataModel.IsValid = false;
                    }
                }
                else
                {
                    salesDataModel.Message = "'" + salesDataModel.SalesFileName + "' file is not supported. ";
                    salesDataModel.IsValid = false;
                }

                return(View("View", salesDataModel));
            }
            catch
            {
                return(View("View"));
            }
        }
Exemple #12
0
 public static void InsertDealIntoDocument(DealInfo dealInfo)
 {
     InsertLinkIntoDocument("W", dealInfo.ID, dealInfo.Url, DealTooltip, dealInfo.RecordNumber);
 }
Exemple #13
0
 private void OnDeal(DealInfo e)
 {
     if (onDealEvent != null)
         onDealEvent(this, e);
 }
Exemple #14
0
        void Map(DealInfo deal, UpGradeOrder order)
        {
            //第三方买家订单信息
            order.MallOrderBuyer = new MallOrderBuyerInfo()
            {
                BuyerNick     = deal.buyerName,
                MallOrderId   = deal.dealCode,
                BuyerMessage  = deal.buyerRemark ?? string.Empty,
                SellerMessage = deal.dealNote ?? string.Empty + "。" + deal.comboInfo ?? string.Empty
            };

            if (deal.itemList != null)
            {
                //订单明细列表
                order.UpGradeOrderItems = deal.itemList.Select(item => new UpGradeOrderItem
                {
                    MallProductCode   = !string.IsNullOrEmpty(item.stockLocalCode) ? item.stockLocalCode : item.itemLocalCode,
                    MallProductName   = item.itemName,
                    MallProductAttrId = item.skuId ?? string.Empty,
                    MallProductAttrs  = item.stockAttr ?? string.Empty,
                    OrderId           = deal.dealCode,
                    MallPrice         = deal.dealPayFeeTotal == 0 ? 0 :
                                        Math.Round((
                                                       (deal.dealPayFeeTotal
                                                        + decimal.Parse(string.IsNullOrEmpty(item.wanggouQuanAmt) ? "0" : item.wanggouQuanAmt))
                                                       / (deal.dealPayFeeTotal - deal.couponFee)
                                                       * (item.itemDealPrice - (item.itemAdjustPrice + item.itemDiscountFee) / item.itemDealCount)
                                                       ) / 100, 2),
                    MallAmount = deal.dealPayFeeTotal == 0 ? 0 :
                                 Math.Round((
                                                (deal.dealPayFeeTotal
                                                 + decimal.Parse(string.IsNullOrEmpty(item.wanggouQuanAmt) ? "0" : item.wanggouQuanAmt))
                                                / (deal.dealPayFeeTotal - deal.couponFee)
                                                * (item.itemDealPrice - (item.itemAdjustPrice + item.itemDiscountFee) / item.itemDealCount)
                                                ) / 100, 2) * item.itemDealCount,
                    Quantity        = item.itemDealCount,
                    DiscountFee     = item.itemDiscountFee / 100,
                    MallOrderItemId = item.dealSubCode
                }).ToList();
            }

            //第三方订单交易信息
            order.MallOrderPayment = new MallOrderPaymentInfo()
            {
                Payment     = deal.totalCash / 100,
                AlipayNo    = deal.tenpayCode ?? string.Empty,
                PostFee     = decimal.Parse(deal.freight ?? "0") / 100,
                DiscountFee = deal.couponFee / 100,
                PayTime     = deal.payTime
            };

            #region 当明细金额合计与实收金额不等时,将差额分摊到最后一个商品上

            if ((order.MallOrderPayment.Payment - order.MallOrderPayment.PostFee) != order.UpGradeOrderItems.Sum(i => i.MallAmount))
            {
                var _amt   = 0m;
                var _count = 0;
                foreach (var item in order.UpGradeOrderItems)
                {
                    _count++;
                    if (_count == order.UpGradeOrderItems.Count)
                    {
                        item.MallAmount = (order.MallOrderPayment.Payment - order.MallOrderPayment.PostFee) - _amt;
                        break;
                    }
                    _amt += item.MallAmount;
                }
            }

            #endregion

            //订单收货信息
            order.MallOrderReceive = new MallOrderReceiveInfo()
            {
                City           = string.Empty,
                Province       = string.Empty,
                District       = string.Empty,
                ReceiveAddress = deal.receiverAddress ?? string.Empty,
                ReceiveContact = deal.receiverName ?? string.Empty,
                TelPhone       = deal.receiverPhone ?? string.Empty,
                Mobile         = deal.receiverMobile ?? string.Empty,
                PostCode       = deal.receiverPostcode ?? string.Empty
            };
        }
 public void StartNewDeal(DealInfo dealInfo)
 {
     this.hand.Clear();
 }
Exemple #16
0
        /// <summary>
        /// 取变更单(动态更新流程)的处理,单独处理的
        /// </summary>
        /// <returns></returns>
        private static DealInfo GetDealFormInfoofChange(string userId, Guid formId)
        {
            var dealInfo = new DealInfo();
            dealInfo.DealFormId = GetDealForm(formId);
            //   var sql = string.Format(" select count(FormId) from WF_ModifyStatesInstance where FormId='{0}'  and  ", formId);

            //  var sql = string.Format(" select count(FormId) from WF_ModifyStatesInstance where FormId='{0}'   and  ExcuteState<>{1}  ", formId, (int)ExcuteState.Excuted);

            var sql = string.Format(" select  COUNT(CurrentWfState) from  WF_Instance a, WF_Config b where a.FormID='{0}'  and  UPPER(b.CodeValue)=UPPER(a.CurrentWfState)  ", formId);

            if (Convert.ToInt32(DataHelper.ExecuteScalar(sql)) > 0) //已经开始更改工作流了,取新的处理按钮
            {
                var stateId = GetCurrentState(formId);
                if (stateId != null && stateId.Count > 0)
                {
                    var dealWays = new Dictionary<string, string>();
                    if (stateId.Count == 1)  //normal
                    {
                        dealInfo.HasAuth = WfModifyStatesInstanceBusiness.HasDealAuth(userId, formId, stateId[0]);
                        if (dealInfo.HasAuth)
                        {
                            sql = string.Format("  select DealWayId,DealWayName  from WF_ModifyStatesDealWayDefine where StateId='{0}'  ", stateId[0]);
                            var dt = DataHelper.ExcuteQuery(sql);
                            foreach (DataRow row in dt.Rows)
                            {
                                dealWays.Add(row["DealWayId"].ToString(), row["DealWayName"].ToString());
                            }
                            //  dealInfo.DealFormId = GetDealForm(formId);
                            //  dealInfo.DealWays = dealWays;
                        }
                    }
                    else  //parallel
                    {
                        foreach (var id in stateId)
                        {
                            dealInfo.HasAuth = WfModifyStatesInstanceBusiness.HasDealAuth(userId, formId, id);
                            if (dealInfo.HasAuth)
                            {
                                sql = string.Format("  select DealWayId,DealWayName  from WF_ModifyStatesDealWayDefine where StateId='{0}'  ", id);
                                var dt = DataHelper.ExcuteQuery(sql);
                                foreach (DataRow row in dt.Rows)
                                {
                                    dealWays.Add(row["DealWayId"].ToString(), row["DealWayName"].ToString());
                                }
                            }
                            //   dealInfo.DealFormId = GetDealForm(formId);
                            //   dealInfo.DealWays = dealWays;
                        }

                        //    dealInfo.HasAuth = dealInfo.DealWays.Count > 0;
                    }
                }
                return dealInfo;
            }
            else //按照原来的处理方式处理
            {
                var wfinstance = WfInstanceBusiness.GetWfInstanceBusinessByFormID(formId);
                var lev = WfSupportGroupMembersBusiness.GetSupportGroupMemberLevel(userId, wfinstance.CurrentDealDeptId, "");
                dealInfo.DealFormId = GetDealForm(formId);
                if (string.IsNullOrEmpty(userId))
                {
                    dealInfo.HasAuth = false;
                    dealInfo.DealWays = null;
                }
                else if (wfinstance.CurrentDealPersonLevel == 0 && userId == wfinstance.StartUserID.ToString())
                //申请人(处理人级别为0的是申请人)
                {
                    dealInfo.HasAuth = true;
                    //   dealInfo.DealWays = GetDealWays(formId);
                }
                else if (lev != null && lev.Contains(wfinstance.CurrentDealPersonLevel)) //有权限
                {
                    if (string.IsNullOrEmpty(wfinstance.CurrentDealPersonID))
                    {
                        dealInfo.HasAuth = true;
                        //       dealInfo.DealWays = GetDealWays(formId);
                    }
                    else if (wfinstance.CurrentDealPersonID == userId)
                    {
                        dealInfo.HasAuth = true;
                        //      dealInfo.DealWays = GetDealWays(formId);
                    }
                    else
                    {
                        dealInfo.HasAuth = false;
                        dealInfo.DealWays = null;
                    }
                }
                else
                {
                    dealInfo.HasAuth = false;
                    dealInfo.DealWays = null;
                }
                return dealInfo;
            }
        }
Exemple #17
0
        /// <summary>
        ///  根据当前登录人ID,票单号提取处理表单的信息
        /// </summary>
        /// <param name="userId">当前用户id</param>
        /// <param name="formId">票单号</param>
        /// <param name="businessType">业务类别 </param>
        /// <returns></returns>
        public static DealInfo GetDealFormInfo(Guid userId, Guid formId, string businessType)
        {
            var dealInfo = new DealInfo();
            var wfinstance = WfInstanceBusiness.GetWfInstanceBusinessByFormID(formId);
            var lev = WfSupportGroupMembersBusiness.GetSupportGroupMemberLevel(userId.ToString(), wfinstance.CurrentDealDeptId,
                                                                               businessType);
            dealInfo.DealFormId = Interfaces.GetDealForm(formId);

            if (wfinstance.CurrentStateType == (int)EnumWfStateType.Parllel)
            {
                GetParallelDealPersonAuth(formId, wfinstance.CurrentWfState, userId, lev, ref dealInfo);
            }
            else
            {
                if (userId == Guid.Empty)
                {
                    dealInfo.HasAuth = false;
                    dealInfo.DealWays = null;
                }
                else if (wfinstance.CurrentDealPersonLevel == 0 && userId == wfinstance.StartUserID)
                //申请人(处理人级别为0的是申请人)
                {
                    dealInfo.HasAuth = true;
                    dealInfo.DealWays = GetDealWays(formId);
                }
                else if (wfinstance.CurrentDealPersonID.ToUpper() == userId.ToString().ToUpper()) //容错处理,如果当前处理人已经是当前登录人,允许处理
                {
                    dealInfo.HasAuth = true;
                    dealInfo.DealWays = GetDealWays(formId);
                }
                else if (lev != null && lev.Contains(wfinstance.CurrentDealPersonLevel)) //有权限
                {
                    if (string.IsNullOrEmpty(wfinstance.CurrentDealPersonID))
                    {
                        dealInfo.HasAuth = true;
                        dealInfo.DealWays = GetDealWays(formId);
                    }
                    else if (wfinstance.CurrentDealPersonID.ToUpper() == userId.ToString().ToUpper())
                    {
                        dealInfo.HasAuth = true;
                        dealInfo.DealWays = GetDealWays(formId);
                    }
                    else //可以转入
                    {
                        dealInfo.HasAuth = true;
                        dealInfo.DealWays = new Dictionary<string, DealWaysInfo>();
                        var dealwaysInfo = new DealWaysInfo();
                        dealwaysInfo.DealWayFormId = "PublicDeal";
                        dealwaysInfo.DealWayId = Common.DealWayIdofSnatch;
                        dealwaysInfo.DealWayName = "转入";
                        dealwaysInfo.IsNewBusiness = false;
                        dealInfo.DealWays.Add(dealwaysInfo.DealWayId, dealwaysInfo);
                    }
                }
                else
                {
                    dealInfo.HasAuth = false;
                    dealInfo.DealWays = null;
                }
            }
            Dictionary<string, DealWaysInfo> dealWaysInfos = dealInfo.DealWays;
            var result = GetRisebutton(businessType, lev, ref dealWaysInfos);
            dealInfo.DealWays = dealWaysInfos;
            dealInfo.HasAuth = dealInfo.HasAuth ? dealInfo.HasAuth : result;
            return dealInfo;
        }
Exemple #18
0
        /// <summary>
        /// 获取页面处理权限
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="formId"></param>
        /// <param name="currentRoleCodes"></param>
        /// <param name="deptGuid">用户部门</param>
        /// <returns></returns>
        public static DealInfo GetDealFormInfo(Guid userId, Guid formId, List<string> currentRoleCodes, Guid deptGuid)
        {
            try
            {
                var dealInfo = new DealInfo();

                var sql =
                    string.Format(" select count(*) from WF_Messages a with (nolock) where a.ReceiveUserId='{0}' and a.FormID='{1}'   ",
                                  userId, formId);
                var num = Convert.ToInt32(DataHelper.ExecuteScalar(sql));

                if (num > 0)  //有访问权限,看看有无操作权限
                {
                    dealInfo.HasAuth = true;
                    dealInfo.DealFormId = GetDealForm(formId);

                    if (currentRoleCodes != null && currentRoleCodes.Count > 0)
                    {
                        dealInfo.Branches = GetBranches(formId, currentRoleCodes, userId, deptGuid);
                    }
                    else
                    {
                        dealInfo.Branches = new Dictionary<Guid, string>();
                    }
                }
                else //无访问权限,什么权限都没有
                {
                    dealInfo.HasAuth = false;
                }

                return dealInfo;
            }
            catch (Exception ex)
            {
                LogWritter.WriteSystemExceptionLog(ex);
                return null;
            }
        }
Exemple #19
0
 public void SellDown(DealInfo dealinfo)
 {
     //SellDownButton.Click();
     sellDownButton.Click();
 }
 public DealInfoDecorator(DealInfo component, List <LegalParty> legalParties)
 {
     _component    = component;
     _legalParties = legalParties;
 }
Exemple #21
0
 void MP_onDealEvent(object sender, DealInfo e)
 {
     Invoke(new MethodInvoker(
               delegate()
               {
                   try
                   {
                       dgDeals.Rows.Add();
                       dgDeals[0, dgDeals.Rows.Count - 1].Value = e.Id;
                       dgDeals[1, dgDeals.Rows.Count - 1].Value = e.InstrId;
                       dgDeals[2, dgDeals.Rows.Count - 1].Value = e.Time;
                       dgDeals[3, dgDeals.Rows.Count - 1].Value = e.Price;
                       dgDeals[4, dgDeals.Rows.Count - 1].Value = e.Volume;
                       if (e.IdOrderBuy > e.IdOrderSell)
                           dgDeals[5, dgDeals.Rows.Count - 1].Value = "Buy";
                       else
                           dgDeals[5, dgDeals.Rows.Count - 1].Value = "Sell";
                       dgDeals[6, dgDeals.Rows.Count - 1].Value = e.IdOrderSell;
                       dgDeals[7, dgDeals.Rows.Count - 1].Value = e.IdOrderBuy;
                       dgDeals[8, dgDeals.Rows.Count - 1].Value = e.ResultPos;
                   }
                   catch (Exception err)
                   {
                       MessageBox.Show(err.Message);
                   }
               }));
 }
Exemple #22
0
        /// <summary>
        ///  根据当前登录人ID,票单号提取处理表单的信息
        /// </summary>
        /// <param name="userId">当前用户id</param>
        /// <param name="formId">票单号</param>
        /// <returns></returns>
        public static DealInfo GetDealFormInfo(string userId, Guid formId)
        {
            var businessType = GetBusinessType(formId);
            if (businessType == 5 || businessType == 6) //这里写死了个5????????????????????????????????????????????????????????????????
            {
                return GetDealFormInfoofChange(userId, formId);
            }
            else
            {
                var dealInfo = new DealInfo();
                var wfinstance = WfInstanceBusiness.GetWfInstanceBusinessByFormID(formId);
                var lev = WfSupportGroupMembersBusiness.GetSupportGroupMemberLevel(userId, wfinstance.CurrentDealDeptId, "");
                dealInfo.DealFormId = GetDealForm(formId);
                if (string.IsNullOrEmpty(userId))
                {
                    dealInfo.HasAuth = false;
                    dealInfo.DealWays = null;
                }
                else if (wfinstance.CurrentDealPersonLevel == 0 && userId == wfinstance.StartUserID.ToString())
                //申请人(处理人级别为0的是申请人)
                {
                    dealInfo.HasAuth = true;
                    //  dealInfo.DealWays = GetDealWays(formId);
                }
                else if (lev != null && lev.Contains(wfinstance.CurrentDealPersonLevel)) //有权限
                {
                    if (string.IsNullOrEmpty(wfinstance.CurrentDealPersonID))
                    {
                        dealInfo.HasAuth = true;
                        //     dealInfo.DealWays = GetDealWays(formId);
                    }
                    else if (wfinstance.CurrentDealPersonID == userId)
                    {
                        dealInfo.HasAuth = true;
                        //    dealInfo.DealWays = GetDealWays(formId);
                    }
                    else  //可以转入
                    {
                        dealInfo.HasAuth = true;
                        //     dealInfo.DealWays = new Dictionary<string, string>();
                        // dealInfo.DealWays.Add(Guid.Empty.ToString(), "转入");
                    }
                }
                else
                {
                    dealInfo.HasAuth = false;
                    dealInfo.DealWays = null;
                }

                return dealInfo;
            }
        }
Exemple #23
0
    void EndDeal(DealInfo TargetLoan)
    {
        TargetLoan.CostomerValue.GetEconomyValue().GetComponent <EconomyValue>().DeletePersistHistory(TargetLoan.ServiceBank.Name + " Loan Interest");

        TargetLoan.ServiceBank.DealList.Remove(TargetLoan);
    }
Exemple #24
0
 public DealInfoTest()
 {
     _dealInfo = new DealInfo();
 }
Exemple #25
0
        /// <summary>
        /// 取用户对业务票单的处理权限信息
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="formId"></param>
        /// <param name="currentRoleCodes"></param>
        /// <returns></returns>
        public static DealInfo GetDealFormInfo(Guid userId, Guid formId, List<string> currentRoleCodes, Guid currentUserDeptId)
        {
            try
            {
                var dealInfo = new DealInfo();

                var sql =
                    string.Format(" select count(*) from WF_Instance_ACL a where   a.UserId='{0}' and a.FormID='{1}'   ",
                                  userId, formId);
                var num = Convert.ToInt32(DataHelper.ExecuteScalar(sql));

                if (num > 0)  //有访问权限,看看有无操作权限
                {
                    dealInfo.HasAuth = true;
                    dealInfo.DealFormId = GetDealForm(formId);
                    //sql = string.Format(" select count(*) from WF_Messages where  FormID='{0}' and ReceiveUserId='{1}'  and MessageType={2} ", formId, userId, (int)EnumWfMessageType.WaitForDo);
                    //num = Convert.ToInt32(DataHelper.ExecuteScalar(sql));
                    //if (num > 0)  //有处理权限
                    //{
                    dealInfo.Branches = GetBranches(formId, currentRoleCodes, userId, currentUserDeptId);
                    //}
                    //else  //没有处理权限
                    //{
                    //    dealInfo.Branches = null;
                    //}
                }
                else //无访问权限,什么权限都没有
                {
                    dealInfo.HasAuth = false;
                }

                return dealInfo;
            }
            catch (Exception ex)
            {
                LogWritter.WriteSystemExceptionLog(ex);
                return null;
            }
        }
Exemple #26
0
 public void StartNewDeal(DealInfo dealInfo)
 {
     //throw new NotImplementedException();
 }
Exemple #27
0
        /// <summary>
        /// 取并发环节处理人权限
        /// </summary>
        /// <param name="formId"></param>
        /// <param name="currentWfStateId"></param>
        /// <param name="currentUserId"></param>
        /// <param name="currentUserlev"> </param> 
        private static void GetParallelDealPersonAuth(Guid formId, Guid currentWfStateId, Guid currentUserId, List<int> currentUserlev, ref  DealInfo dealInfo)
        {
            var sql =
                string.Format(
                    "select * from WF_InstanceStates with (nolock) where FormID='{0}'  and WfState='{1}' and CompleteTime is null ", formId, currentWfStateId);
            var dt = DataHelper.ExecuteQuery(sql);
            var lev = new List<int>();
            var supportorIds = new List<string>();
            if (dt != null && dt.Rows.Count > 0)
            {
                foreach (DataRow row in dt.Rows)
                {
                    lev.Add(Convert.ToInt32(row["DealPersonLevel"]));
                    supportorIds.Add(row["TransactUserID"].ToString().ToUpper());
                }

                if (supportorIds.Contains(currentUserId.ToString().ToUpper())) //有权限,当前用户是处理人之一
                {
                    dealInfo.HasAuth = true;
                    dealInfo.DealWays = GetDealWays(formId);
                }
                else //当前用户不是指定用户,看看能否转入
                {
                    var isTheLevel = false;
                    if (currentUserlev != null)
                    {
                        foreach (var clev in currentUserlev) //当前用户的级别
                        {
                            if (lev.Contains(clev))
                            {
                                isTheLevel = true;
                                break;
                            }
                        }
                    }
                    if (isTheLevel) //同级用户有处理权限
                    {
                        dealInfo.HasAuth = true;
                        dealInfo.DealWays = new Dictionary<string, DealWaysInfo>();
                        var dealwaysInfo = new DealWaysInfo();
                        dealwaysInfo.DealWayFormId = "";
                        dealwaysInfo.DealWayId = Common.DealWayIdofSnatch;
                        dealwaysInfo.DealWayName = "转入";
                        dealwaysInfo.IsNewBusiness = false;
                        dealInfo.DealWays.Add(dealwaysInfo.DealWayId, dealwaysInfo);
                    }
                    else //不同级,没权限
                    {
                        dealInfo.HasAuth = false;
                        dealInfo.DealWays = null;
                    }
                }

            }
            else //数据异常,不给处理权限。
            {
                dealInfo.HasAuth = false;
                dealInfo.DealWays = null;
            }
        }
Exemple #28
0
 public void BuyUp(DealInfo dealinfo)
 {
     //setData(dealinfo)
     buyUpButton.Click();
 }