Пример #1
0
        public ActionResult GetUpdateGoldByRMB(Dictionary <string, string> queryvalues)
        {
            int        _no      = queryvalues.ContainsKey("no") ? Convert.ToInt32(queryvalues["no"]) : -1;
            Int64      _gold    = queryvalues.ContainsKey("gold") ? Convert.ToInt64(queryvalues["gold"]) : 0;
            DaiLiUsers daliuser = DaiLiBLL.GetDaiLiUsers(_no);

            string fen     = daliuser.FenChenRate;
            string goldFen = daliuser.GoldRate;

            string[] fens    = fen.Split(':');
            int      fen1    = Convert.ToInt32(fens[0].Trim());
            int      fen2    = Convert.ToInt32(fens[1].Trim());
            double   fenLast = fen2 / fen1;

            string[] goldFens    = goldFen.Split(':');
            int      goldFen1    = Convert.ToInt32(goldFens[0].Trim());
            int      goldFen2    = Convert.ToInt32(goldFens[1].Trim());
            double   goldFenLast = goldFen2 / goldFen1;

            //将人民币转换为金币
            _gold = Convert.ToInt64(_gold * (fenLast + 1) * goldFenLast);



            return(Content(_gold.ToString()));
        }
Пример #2
0
        // GET: DaiLi
        public ActionResult Index()
        {
            IEnumerable <DaiLiUsers> modelList = DaiLiBLL.GetDaiLiUsers();



            return(View(modelList));
        }
Пример #3
0
        public ActionResult UpdateKuCun(Dictionary <string, string> queryvalues)
        {
            int        _no      = queryvalues.ContainsKey("no") ? Convert.ToInt32(queryvalues["no"]) : -1;
            Int64      _gold    = queryvalues.ContainsKey("gold")? Convert.ToInt64(queryvalues["gold"]) : 0;
            Int64      rmb      = _gold;
            DaiLiUsers daliuser = DaiLiBLL.GetDaiLiUsers(_no);

            string fen     = daliuser.FenChenRate;
            string goldFen = daliuser.GoldRate;

            string[] fens    = fen.Split(':');
            int      fen1    = Convert.ToInt32(fens[0].Trim());
            int      fen2    = Convert.ToInt32(fens[1].Trim());
            double   fenLast = fen2 / fen1;

            string[] goldFens    = goldFen.Split(':');
            int      goldFen1    = Convert.ToInt32(goldFens[0].Trim());
            int      goldFen2    = Convert.ToInt32(goldFens[1].Trim());
            double   goldFenLast = goldFen2 / goldFen1;

            //将人民币转换为金币
            _gold = Convert.ToInt64(_gold * (fenLast + 1) * goldFenLast);



            if (_no < 0)
            {
                return(Content("-1"));
            }
            else
            {
                int i = DaiLiBLL.UpdateDaiLiKuCun(_no, _gold, DaiLiType.充值库存);
                if (i < 0)
                {
                    return(Content("-2"));
                }
                else
                {
                    DaiLiBLL.InsertKuCunFlow(new GL.Data.Model.KuCunFlow()
                    {
                        CreateTime   = DateTime.Now.ToString(),
                        Operation    = "添加",
                        OperGold     = _gold,
                        OperUserName = User.Identity.Name,
                        DaiLiNo      = _no,
                        FenChenRate  = fen,
                        GoldRate     = goldFen,
                        Rmb          = rmb
                    });



                    return(Content("1"));
                }
            }
        }