Ejemplo n.º 1
0
        public JsonResult GetAllDepositAccount()
        {
            int    offset = int.Parse(Request.Form["offset"]);
            int    pageSize = int.Parse(Request.Form["pageSize"]);
            string dateTime = Request.Form["dateTime"];
            string search = Request.Form["search"].Trim();
            string stime = ""; string etime = "";

            if (!String.IsNullOrEmpty(dateTime))
            {
                stime = dateTime.Split('—')[0] + " 00:00";
                etime = dateTime.Split('—')[1] + " 23:59";
            }
            else
            {
                stime = "1971-01-01 00:00"; etime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
            }

            stime = stime.Replace("-", "").Replace(":", "").Replace(" ", "").Replace("/", "");
            etime = etime.Replace("-", "").Replace(":", "").Replace(" ", "").Replace("/", "");
            int total                   = 0;
            IList <DepositAccount> list = new DepositAccountBll().GetDepositAccount(offset, pageSize, search, stime, etime, out total);

            var gridData = new { rows = list, total = total };

            return(Json(gridData));
        }
Ejemplo n.º 2
0
        public JsonResult GetAccountWithdraw()
        {
            int    offset = int.Parse(Request.Form["offset"]);
            int    pageSize = int.Parse(Request.Form["pageSize"]);
            string dateTime = Request.Form["dateTime"];
            string search = Request.Form["search"].Trim();
            string stime = ""; string etime = "";

            if (!String.IsNullOrEmpty(dateTime))
            {
                stime = dateTime.Split('—')[0].Trim() + " 00:00:00";
                etime = dateTime.Split('—')[1].Trim() + " 23:59:59";
            }
            else
            {
                stime = "1970-01-01 00:00:00"; etime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            }

            int total = 0;
            IList <AccountWithdrawals> list = new DepositAccountBll().GetAccountWithdrawals(offset, pageSize, search, stime, etime, out total);

            var gridData = new { rows = list, total = total };

            return(Json(gridData));
        }
Ejemplo n.º 3
0
        public void OnlineDeposit(string money, string account, string address, string name, string email, string phone, string supplement, string platformType, string orderNumber, string billno)
        {
            DepositAccount deposit = new DepositAccount
            {
                DepositMoney  = money,
                AccountId     = account,
                Address       = address,
                Name          = name,
                Email         = email,
                Phone         = phone,
                Explanation   = supplement,
                OrderNumber   = orderNumber,
                ZipCode       = "",
                PlatformType  = platformType,
                AttachData    = "",
                BankReturnMsg = "",
                Billno        = billno,
                Currency_Type = "",
                DepositId     = "",
                IPSBillno     = "",
                Mercode       = "",
                OrderAmount   = money,
                OrderDate     = "",
                Retencodetype = "",
                SignatureInfo = "",
                SymbolSuccess = "N"
            };

            Session["DepositAccount"] = deposit;
            Session.Timeout           = 300;
            DepositAccount acc = new DepositAccountBll().AddDepositAccount(deposit);
        }
Ejemplo n.º 4
0
        public string DeleteDepositAccount(string depositId, string payType)
        {
            LOG log = new DepositAccountBll().DeleteDepositAccount(depositId);

            return(new UserLogBll().InsertLogs(new UserLog {
                Account = log.Account, Explain = "入金状态", LogDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), LogIP = IPHelper.GetIp(), Property1 = payType + ",入金" + log.Money + ",订单已取消"
            }) ? "success" : "error");
        }
Ejemplo n.º 5
0
        public int AccountWithdrawals(string HolderName, string WWTrading_account, string WWPhone, string WWEmail, string WWAddress, string WWCountry, string WWProvince,
                                      string WWCity, string WWZipCode, string WWMoney, string WWAccountHolder, string IsCloseAccountY, string IsCloseAccountText,
                                      string WWBankName, string WWBankAccount, string AccountHolderName, string WWSWIFT_Code, string WWBankAddress, string WWBankCountry,
                                      string WWBankProvince, string WWBankCity, string WWBankZipCode, string RadioIsTransitBankN, string WWTransitBankName,
                                      string WWTransitBankAcoount, string WWTransitAcoountHolderName, string WWTransitSWIFTCode, string WWTransitBankAddress,
                                      string WWTransitCountry, string WWTransitProvince, string WWTransitCity, string WWTransitZipCode, string WWMainAccountHolderName)
        {
            AccountWithdrawals acc = new AccountWithdrawals
            {
                WithdrawalsAccountHolder = HolderName,               //账户持有人姓名
                WithdrawalsAccount       = WWTrading_account,        //交易账号
                Phone                  = WWPhone,                    //联系电话
                WithdrawalsEmail       = WWEmail,                    //电子邮箱
                WithdrawalsAddress     = WWAddress,                  //地址
                WithdrawalsCountry     = WWCountry,                  //个人居住国家
                WithdrawalsProvince    = WWProvince,                 //个人居住州
                WithdrawalsCity        = WWCity,                     //个人居住城市
                WithdrawalsCityZipCode = WWZipCode,                  //个人居住城市邮编
                Money                  = WWMoney,                    //取款金额
                BelongsPlatform        = WWAccountHolder,            //平台meta trader 4
                IsCloseAccount         = IsCloseAccountY,            //是否关闭交易账户
                CloseReason            = IsCloseAccountText,         //关闭账户原因
                BankName               = WWBankName,                 //银行名称
                BankAccount            = WWBankAccount,              //银行账号
                BankHolder             = AccountHolderName,          //银行账户持有人姓名
                SWIFT_Code             = WWSWIFT_Code,               //国际银行代码(SWIFT Code)
                BankAddress            = WWBankAddress,              //银行地址
                BankCountry            = WWBankCountry,              //银行所在国家
                BankProvince           = WWBankProvince,             //银行所在州,省
                BankCity               = WWBankCity,                 //银行所在城市
                BankCityZipCode        = WWBankZipCode,              //银行所在城市邮编
                IsTransitBank          = RadioIsTransitBankN,        //是否有中转银行
                TransitBankName        = WWTransitBankName,          //中转银行名称
                TransitBankAccount     = WWTransitBankAcoount,       //中转银行账号
                TransitBankHolder      = WWTransitAcoountHolderName, //中转银行账户持有人姓名
                TransitBankAddress     = WWTransitSWIFTCode,         //中转银行国际银行代码
                TransitBankSWIFICode   = WWTransitBankAddress,       //中转银行地址
                TransitBankCountry     = WWTransitCountry,           //中转银行所在国家
                TransitBankProvince    = WWTransitProvince,          //中转银行所在州省
                TransitBankCity        = WWTransitCity,              //中转银行所在城市
                TransitBankCityZipCode = WWTransitZipCode,           //中转银行所在城市右邮编
                MainAccountName        = WWMainAccountHolderName,    //主要账户持有人姓名
                MinorAccountName       = "",                         //次要账户持有人姓名
                WithdrawalsDate        = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                ProcessingStatus       = "未处理",
                Explanation            = ""
            };

            InsertLogs(new UserLog {
                Account = WWTrading_account, LogIP = IPHelper.GetIp(), LogDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Explain = "出金操作", Property1 = "出金" + WWMoney + ",申请已提交,正在处理中..."
            });
            bool flag = new DepositAccountBll().AddAccountWithdrawals(acc);

            return(Convert.ToInt32(flag));
        }
Ejemplo n.º 6
0
        public string UpdateAccountWithdraw(string withdrawId)
        {
            LOG log = new DepositAccountBll().UpdateAccountWithdrawalsStatus(withdrawId);

            if (log != null)
            {
                return(new UserLogBll().InsertLogs(new UserLog {
                    Account = log.Account, Explain = "出金状态", LogIP = IPHelper.GetIp(), LogDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Property1 = "出金" + log.Money + ",已处理"
                }) ? "success" : "error");
            }
            else
            {
                return("error");
            }
        }
Ejemplo n.º 7
0
        public string DelereAccountWithdraw(string id)
        {
            LOG log = new DepositAccountBll().DeleteAccountWithdrawalsInfo(id);

            if (log != null)
            {
                return(new UserLogBll().InsertLogs(new UserLog {
                    Account = log.Account, LogIP = IPHelper.GetIp(), LogDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Explain = "出金状态", Property1 = "出金" + log.Money + ",申请已取消"
                }) ? "success" : "error");
            }
            else
            {
                return("error");
            }
        }
Ejemplo n.º 8
0
        public void OnlineDeposit(string money, string account, string address, string name, string email, string phone, string supplement, string platformType, string orderNumber, string billno)
        {
            DepositAccount deposit = new DepositAccount
            {
                DepositMoney  = money,
                AccountId     = account,
                Address       = address,
                Name          = name,
                Email         = email,
                Phone         = phone,
                Explanation   = supplement,
                OrderNumber   = orderNumber,
                ZipCode       = "",
                PlatformType  = platformType,
                AttachData    = "",
                BankReturnMsg = "",
                Billno        = billno,
                Currency_Type = "",
                DepositId     = "",
                IPSBillno     = "",
                Mercode       = "",
                OrderAmount   = money,
                OrderDate     = "",
                Retencodetype = "",
                SignatureInfo = "",
                SymbolSuccess = "N"
            };
            BinaryFormatter bf = new BinaryFormatter();
            MemoryStream    ms = new MemoryStream();

            bf.Serialize(ms, deposit);
            byte[] result = new byte[ms.Length];
            result = ms.ToArray();
            string temp = Convert.ToBase64String(result);

            ms.Flush();
            ms.Close();
            HttpCookie cookie = new HttpCookie("DepositAccount");

            cookie.Expires = DateTime.Now.AddMinutes(30.0);
            cookie.Value   = temp;
            Response.SetCookie(cookie);
            DepositAccount acc = new DepositAccountBll().AddDepositAccount(deposit);

            InsertLogs(new UserLog {
                Account = account, LogIP = IPHelper.GetIp(), LogDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Explain = "入金操作", Property1 = "入金" + money + ",申请已提交,正在处理中..."
            });
        }
Ejemplo n.º 9
0
        public JsonResult GetWithdrawls(string withdrawlsId)
        {
            AccountWithdrawals accountWithdrawals = new DepositAccountBll().GetAccountWithdrawalsByAccountWithdrawalsId(withdrawlsId);

            return(Json(accountWithdrawals));
        }
Ejemplo n.º 10
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Charset     = "utf-8";

            try
            {
                //string user = context.Request.QueryString["user"].ToString();//当前登陆用户
                string         strFilePath = context.Request.Form["strFilePath"].ToString();
                string         typeName    = context.Request.Form["typeName"].ToString();
                string         userName    = context.Request.Form["userName"].ToString();
                HttpPostedFile file        = context.Request.Files["upload_Agency"];

                string uploadPath = HttpContext.Current.Server.MapPath("..\\..\\Upload\\Credentials") + "\\" + strFilePath + "\\"; //@context.Request["folder"]
                if (file != null)
                {
                    string name = file.FileName;
                    string type = name.Substring(name.LastIndexOf('.')).ToLower();
                    if (type == ".jpg" || type == ".jpeg" || type == ".png" || type == ".gif" || type == "bmp")
                    {
                        if (File.Exists(uploadPath + name))
                        {
                            context.Response.Write(name);
                        }
                        else
                        {
                            if (!Directory.Exists(uploadPath))
                            {
                                Directory.CreateDirectory(uploadPath);
                            }
                            //FileHelper.DeleteFiles(uploadPath);
                            //string fileName = DateTime.Now.ToString("yyyyMMddHHmmssffff");
                            //string newFileName = fileName + type;
                            file.SaveAs(uploadPath + name);
                            string path = "Upload/Credentials/" + strFilePath + "/" + name;
                            bool   flag = new DepositAccountBll().AddUploadImgInfo(new UploadImage
                            {
                                AccountID        = "",
                                PictureTypeId    = typeName,
                                UploadName       = userName,
                                PictureUrl       = path,
                                UPloadTime       = DateTime.Now.ToString(),
                                AddressDifferent = ""
                            });
                            if (flag)
                            {
                                context.Response.Write("1");
                            }
                            else
                            {
                                context.Response.Write("0");
                            }
                            //context.Session["file"] = HttpContext.Current.Server.MapPath(@context.Request["folder"]) + "\\";
                            //下面这句代码缺少的话,上传成功后上传队列的显示不会自动消失
                        }
                    }
                    else
                    {
                        context.Response.Write("0");
                    }
                }
                else
                {
                    context.Response.Write("0");
                }
            }
            catch (Exception e)
            {
                context.Response.Write(e.Message);
            }
        }
Ejemplo n.º 11
0
        public ActionResult ReturnDepositInfo()
        {
            //接收数据
            string billno        = Request["billno"];        //订单编号
            string mercode       = Request["mercode"];       //商户编号
            string amount        = Request["amount"];        //订单金额
            string currency_type = Request["Currency_type"]; //币种
            string mydate        = Request["date"];          //订单日期
            string succ          = Request["succ"];          //成功标示
            string msg           = Request["msg"];           //发卡行的返回信息
            string attach        = Request["attach"];        //商户数据包
            string ipsbillno     = Request["ipsbillno"];     //IPS订单号
            string retEncodeType = Request["retencodetype"]; //交易返回签名方式
            string signature     = Request["signature"];     //数字签名信息
            string bankbillno    = Request["bankbillno"];    //银行信息

            ViewBag.Mercode       = mercode;                 //商户名称
            ViewBag.Billno        = billno;                  //订单编号
            ViewBag.OperatingName = "";                      //操作人姓名
            ViewBag.Amount        = amount;                  //订单金额
            ViewBag.Date          = mydate;                  //订单日期
            ViewBag.Succ          = succ;                    //成功标志
            ViewBag.Msg           = msg;                     //发卡行的返回信息
            ViewBag.Ipsbillno     = ipsbillno;               //IPS订单号
            ViewBag.Currency_Type = currency_type;           //币种


            //签名原文
            //billno+【订单编号】+currencytype+【币种】+amount+【订单金额】+date+【订单日期】+succ+【成功标志】+ipsbillno+【IPS订单编号】+retencodetype +【交易返回签名方式】
            string content = "billno" + billno + "currencytype" + currency_type + "amount" + amount + "date" + mydate + "succ" + succ + "ipsbillno" + ipsbillno + "retencodetype" + retEncodeType;

            //签名是否正确
            Boolean verify = false;

            //验证方式:16-md5withRSA  17-md5
            if (retEncodeType == "16")
            {
                string      pubfilename   = "C:\\PubKey\\publickey.txt";
                RSAMD5Class m_RSAMD5Class = new RSAMD5Class();
                int         result        = m_RSAMD5Class.VerifyMessage(pubfilename, content, signature);

                //result=0   表示签名验证成功
                //result=-1  表示系统错误
                //result=-2  表示文件绑定错误
                //result=-3  表示读取公钥失败
                //result=-4  表示签名长度错
                //result=-5  表示签名验证失败
                //result=-99 表示系统锁定失败
                if (result == 0)
                {
                    verify = true;
                }
            }
            else if (retEncodeType == "17")
            {
                //登陆http://merchant.ips.com.cn/商户后台下载的商户证书内容
                //测试
                //string merchant_key = "GDgLwwdK270Qj1w4xho8lyTpRQZV9Jm5x4NwWOTThUa4fMhEBK9jOXFrKRT6xhlJuU2FEa89ov0ryyjfJuuPkcGzO5CeVx5ZIrkkt1aBlZV36ySvHOMcNv8rncRiy3DQ";
                //正式
                string merchant_key = "39623688139801517515914269939447918705664553228860304662446375879188281294146103107913225626829868403968911052533216795596255536";
                //string merchant_key = "75063883549352501246651138596975925426112202685729763141483439666432708412434945277710188303368364524301135170754715194525430514";
                //Md5摘要
                string signature1 = FormsAuthentication.HashPasswordForStoringInConfigFile(content + merchant_key, "MD5").ToLower();

                if (signature1 == signature)
                {
                    verify = true;
                }
            }

            //判断签名验证是否通过
            if (verify == true)
            {
                string          _depositAccount = Request.Cookies["DepositAccount"].Value;
                byte[]          _deposit        = Convert.FromBase64String(_depositAccount);
                MemoryStream    ms             = new MemoryStream(_deposit, 0, _deposit.Length);
                BinaryFormatter bf             = new BinaryFormatter();
                DepositAccount  depositaccount = bf.Deserialize(ms) as DepositAccount;

                //判断交易是否成功
                if (succ != "Y")
                {
                    ViewBag.ReturnDepositInfoStatus = "汇款失败!";
                    InsertLogs(new UserLog {
                        Account = depositaccount.AccountId, LogIP = IPHelper.GetIp(), LogDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Explain = "入金状态", Property1 = "入金" + depositaccount.DepositMoney + ",入金失败"
                    });
                }
                else
                {
                    ViewBag.ReturnDepositInfoStatus = "汇款成功!";
                    InsertLogs(new UserLog {
                        Account = depositaccount.AccountId, LogIP = IPHelper.GetIp(), LogDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Explain = "入金状态", Property1 = "入金" + depositaccount.DepositMoney + ",入金成功"
                    });
                }


                if (depositaccount == null)
                {
                    string[] mer_data = attach.Split('&');
                    if (mer_data.Length != 10)
                    {
                        ViewBag.ReturnDepositInfoStatus += "获取用户信息失败,请与DGM客服联系!";
                    }
                    else
                    {
                        depositaccount = new DepositAccount();
                        depositaccount.DepositMoney = mer_data[0];
                        depositaccount.AccountId    = mer_data[1];
                        depositaccount.Address      = mer_data[2];
                        depositaccount.ZipCode      = "";
                        depositaccount.Name         = mer_data[3];
                        depositaccount.Email        = mer_data[4];
                        depositaccount.Phone        = mer_data[5];
                        depositaccount.Explanation  = mer_data[6];
                        depositaccount.PlatformType = mer_data[7];
                        depositaccount.OrderNumber  = mer_data[8];
                    }
                }
                //****************************************************************
                //比较返回的订单号和金额与您数据库中的金额是否相符
                if (depositaccount.DepositMoney != amount)
                {
                    ViewBag.ReturnDepositInfoStatus += "从IPS返回的数据和本地记录的不符合,失败!";
                }
                if (depositaccount != null)
                {
                    ViewBag.Mercode       = mercode;             //商户名称
                    ViewBag.Billno        = billno;              //订单编号
                    ViewBag.OperatingName = depositaccount.Name; //操作人姓名
                    ViewBag.Amount        = amount;              //订单金额
                    ViewBag.Date          = mydate;              //订单日期
                    ViewBag.Succ          = succ;                //成功标志
                    ViewBag.Msg           = msg;                 //发卡行的返回信息
                    ViewBag.Ipsbillno     = ipsbillno;           //IPS订单号
                    ViewBag.Currency_Type = currency_type;       //币种


                    string message = msg;      //发卡行的返回信息

                    string attachsss = attach; //商户数据包

                    depositaccount.Mercode       = mercode;
                    depositaccount.Billno        = billno;
                    depositaccount.OrderDate     = mydate;
                    depositaccount.SymbolSuccess = succ;
                    depositaccount.BankReturnMsg = msg;
                    depositaccount.IPSBillno     = ipsbillno;
                    depositaccount.Currency_Type = currency_type;
                    depositaccount.OrderAmount   = amount;
                    depositaccount.Retencodetype = retEncodeType;
                    depositaccount.SignatureInfo = signature;
                    depositaccount.AttachData    = attach;
                    DepositAccount deposit = new DepositAccountBll().GetDepositAccountByBillno(depositaccount.Billno);

                    if (deposit == null)
                    {
                        depositaccount = new DepositAccountBll().AddDepositAccount(depositaccount);
                    }
                    else
                    {
                        depositaccount.DepositId = deposit.DepositId;
                        depositaccount           = new DepositAccountBll().ModifyCheckDepositAccount(depositaccount);
                    }
                    if (depositaccount != null)
                    {
                        ViewBag.ReturnDepositInfoStatus += "已提交到系统!";
                    }
                    else
                    {
                        ViewBag.ReturnDepositInfoStatus += "网络异常,请与DGM客服联系!";
                    }
                }
                else
                {
                    ViewBag.ReturnDepositInfoStatus += "系统异常,请与DGM客服联系!";
                }
            }
            else
            {
                ViewBag.ReturnDepositInfoStatus = "数字签名不正确!";
            }
            return(View());
        }