示例#1
0
        public static string BuyStockRight(string mid, int count, Model.StockRightConfig src)
        {
            if (!BLL.ChangeMoney.EnoughChange(mid, count * src.BuyMoney, "MCW"))
            {
                return("您的" + BLL.Reward.List["MCW"].RewardName + "不足");
            }
            Model.StockRight sr = new Model.StockRight();
            sr.BuyCount  = count;
            sr.BuyDate   = DateTime.Now;
            sr.BuyMoney  = count * src.BuyMoney;
            sr.FHCount   = 0;
            sr.FHMoney   = 0;
            sr.IsValid   = true;
            sr.MID       = mid;
            sr.StockType = src.Code;

            Hashtable MyHs = new Hashtable();

            DAL.StockRight.Add(sr, MyHs);
            BLL.ChangeMoney.HBChangeTran(sr.BuyMoney, sr.MID, BLL.Member.ManageMember.TModel.MID, "R_BuySR", null, "MCW", "购买股权", MyHs);
            if (CommonBase.RunHashtable(MyHs))
            {
                return("购买成功");
            }
            return("购买失败");
        }
示例#2
0
        public static Hashtable PutGQFH(int ID, Hashtable MyHs)
        {
            Model.StockRight sr = DAL.StockRight.GetModel(ID);
            var src             = DAL.StockRightConfig.GetStockRightConfigDic()[sr.StockType];
            //分红钱数
            decimal money = (sr.FHMoney + sr.BuyMoney) * src.FHFloat;

            //分红次数
            sr.FHCount++;
            //分红钱数
            sr.FHMoney += money;
            if (sr.FHCount >= src.FHCount)
            {
                sr.IsValid = false;
                sr.OutDate = DateTime.Now;
                //返还本金
                BLL.ChangeMoney.HBChangeTran(sr.BuyMoney, BLL.Member.ManageMember.TModel.MID, sr.MID, "R_FHBJ", null, "MHB", "", MyHs, sr.ID + "", sr.StockType);
            }
            DAL.StockRight.Update(sr, MyHs);
            BLL.ChangeMoney.HBChangeTran(money, BLL.Member.ManageMember.TModel.MID, sr.MID, "R_GQFH", null, "MHB", sr.ID + "", MyHs);

            return(MyHs);
        }