Example #1
0
 public PlayerList(ref SQLBase db)
 {
     myBaseSqlite = db;
     InitializeComponent();
     playerViewModel = new Players(db);
     LoadItemSource();
 }
Example #2
0
 public PrepareGame(ref SQLBase db)
 {
     InitializeComponent();
     FillPickers();
     myBaseSqlite = db;
     GetPlayerNameList();
 }
Example #3
0
 public MyConsole(ref SQLBase db)
 {
     saveCommand  = new Queue <string>();
     mySqliteBase = db;
     cmd          = new ConsoleCommand(ref mySqliteBase);
     InitializeComponent();
     this.BindingContext = cmd;
 }
Example #4
0
 public CreatePlayerPage(ref SQLBase db)
 {
     editMode = false;
     InitializeComponent();
     myBaseSqlite    = db;
     playerViewModel = new Players(db);
     playerViewModel.Collection();
     LoadItemSource();
 }
        public ActionResult QueryOrderStatus(string orderno)
        {
            string  sql = "SELECT paytime FROM order_pay WHERE orderno='" + orderno + "'";
            SQLBase s   = new SQLBase();
            List <List <string> > result = s.ExecuteQuery(sql);

            if (result.Count > 0)
            {
                return(Content(result[0][0]));
            }

            return(Content(""));
        }
Example #6
0
 public MainPage()
 {
     //App.mysettings.FirstRun(false);
     taskRunOlnyInsidePage = true;
     App.mysettings.SetFirstRun();
     App.mysettings.FirstStartLog();
     InitializeComponent();
     myBaseSqlite = new SQLBase(App.mysettings.Server);
     eloViewModel = new Players(myBaseSqlite);
     LoadItemSource();
     System.Diagnostics.Debug.WriteLine(App.mysettings.Background);
     ManageMessage();
 }
Example #7
0
 public Game(GameSetting gameSett, ref SQLBase db)
 {
     playerMp3 = new Playmp3();
     InitializeComponent();
     NavigationPage.SetHasBackButton(this, false);
     myBaseSqlite = db;
     this.game    = ConversionToGameDependecy(gameSett);
     game.InitializePlayerScore();
     game.InitializePlayersElo();
     SwitchOnGame();
     ViewCell();
     SwitchOnSumLbl();
     this.BindingContext = game;
 }
Example #8
0
        public override void ProcessNotify()
        {
            WxPayData notifyData = GetNotifyData();

            //检查支付结果中transaction_id是否存在
            if (!notifyData.IsSet("transaction_id"))
            {
                //若transaction_id不存在,则立即返回结果给微信支付后台
                WxPayData res = new WxPayData();
                res.SetValue("return_code", "FAIL");
                res.SetValue("return_msg", "支付结果中微信订单号不存在");
                LogService.Error(this.GetType().ToString(), "The Pay result is error : " + res.ToXml());
            }

            string transaction_id = notifyData.GetValue("transaction_id") + "";

            LogService.Debug(this.GetType().ToString(), "transaction_id:" + transaction_id);
            //查询订单,判断订单真实性
            if (!QueryOrder(transaction_id))
            {
                //若订单查询失败,则立即返回结果给微信支付后台
                WxPayData res = new WxPayData();
                res.SetValue("return_code", "FAIL");
                res.SetValue("return_msg", "订单查询失败");
                LogService.Error(this.GetType().ToString(), "Order query failure : " + res.ToXml());
            }
            //查询订单成功
            else
            {
                WxPayData res = new WxPayData();
                res.SetValue("return_code", "SUCCESS");
                res.SetValue("return_msg", "OK");
                LogService.Info(this.GetType().ToString(), "order query success : " + res.ToXml());
                LogService.Info(this.GetType().ToString(), "回调信息【out_trade_no】: " + notifyData.GetValue("out_trade_no") + "; time_end:" + notifyData.GetValue("time_end") + "; cash_fee:" + notifyData.GetValue("cash_fee"));
                SQLBase s = new SQLBase();

                float fee = 0;
                try
                {
                    fee = float.Parse(notifyData.GetValue("cash_fee").ToString()) / 100.0F;
                }
                catch (Exception)
                {
                    throw;
                }
                string sql = "update orders set paytime='" + notifyData.GetValue("time_end") + "',cash_fee=" + fee + ",transaction_id='" + notifyData.GetValue("transaction_id") + "' WHERE orderno='" + notifyData.GetValue("out_trade_no") + "'";
                LogService.Error(this.GetType().ToString(), sql);
                s.ExecuteNonQuery(sql);
            }
        }
        public String ExportarPdf(string entidad, string parm1)
        {
            PedidosOnlineEntities db = new PedidosOnlineEntities();
            string llamada           = "";

            if (entidad.ToUpper() == "PROFORMA")
            {
                llamada = "EXEC ProformaExport " + parm1 + "";
                DataSet dt = SQLBase.ReturnDataSet(llamada,
                                                   new SqlConnection(db.Database.Connection.ConnectionString));
                m_plantillas m_plantilla = db.m_plantillas.Where(f => f.Nombre == "RDL_" + entidad).First();
                return(RDL_UTIL.RDL_Generate_PDF_File_VIEW(Server.MapPath("//"), dt, m_plantilla, entidad));
            }
            if (entidad.ToUpper() == "CONTRATO")
            {
                llamada = "EXEC contratos " + parm1 + "";
                DataSet dt = SQLBase.ReturnDataSet(llamada,
                                                   new SqlConnection(db.Database.Connection.ConnectionString));
                m_plantillas m_plantilla = db.m_plantillas.Where(f => f.Nombre == "RDL_" + entidad).First();
                return(RDL_UTIL.RDL_Generate_PDF_File_VIEW(Server.MapPath("//"), dt, m_plantilla, entidad));
            }
            if (entidad.ToUpper() == "SOLICITUDTRANSPORTE")
            {
                llamada = "EXEC SolicitudTransportePDF " + parm1 + "";
                DataSet dt = SQLBase.ReturnDataSet(llamada,
                                                   new SqlConnection(db.Database.Connection.ConnectionString));
                m_plantillas m_plantilla = db.m_plantillas.Where(f => f.Nombre == "RDL_" + entidad).First();
                return(RDL_UTIL.RDL_Generate_PDF_File_VIEW(Server.MapPath("//"), dt, m_plantilla, entidad));
            }
            if (entidad.ToUpper() == "ORDENCOMPRA")
            {
                llamada = "EXEC spOrdenCompra " + parm1 + "";
                DataSet dt = SQLBase.ReturnDataSet(llamada,
                                                   new SqlConnection(db.Database.Connection.ConnectionString));
                m_plantillas m_plantilla = db.m_plantillas.Where(f => f.Nombre == "RDL_" + entidad).First();
                return(RDL_UTIL.RDL_Generate_PDF_File_VIEW(Server.MapPath("//"), dt, m_plantilla, entidad));
            }
            if (entidad.ToUpper() == "FACTURA")
            {
                llamada = "EXEC FacturaExport " + parm1 + "";
                DataSet dt = SQLBase.ReturnDataSet(llamada,
                                                   new SqlConnection(db.Database.Connection.ConnectionString));
                m_plantillas m_plantilla = db.m_plantillas.Where(f => f.Nombre == "RDL_" + entidad).First();
                return(RDL_UTIL.RDL_Generate_PDF_File_VIEW(Server.MapPath("//"), dt, m_plantilla, entidad));
            }
            else
            {
                return("");
            }
        }
Example #10
0
        public Summary(SaveMatch saveMatch, ref SQLBase db)
        {
            NavigationPage.SetHasNavigationBar(this, false);
            sets         = new Settings();
            myBaseSqlite = db;
            match        = saveMatch;
            VievModel    = new Players(myBaseSqlite);
            EloExist();
            SaveToBase();
            InitializeComponent();
            InitalizeLabel();
            this.BindingContext = match;

            //logi
            sets.AddLogs(DateTime.Now.ToString());

            sets.AddLogs(match.InfoDebug);
            sets.EndLog();

            List <Player> players = myBaseSqlite.GetPlayersList();

            foreach (Player item in players)
            {
                System.Diagnostics.Debug.WriteLine("Player " + item.name + "elo = " + item.elo);

                sets.AddLogs("Player " + item.name + "elo = " + item.elo);
            }

            sets.EndLog();

            System.Diagnostics.Debug.WriteLine("MultiplerFromPlace() * MultiplerFromPlayerCount() * MultiplerFromRoundCount() * MultiplerFromMatchCount() * MultiplerFromArrowCount() * MultiplerFromRatio()  + MultiplerEloRelation() + BonusForFirstMatch())");
            sets.AddLogs("MultiplerFromPlace() * MultiplerFromPlayerCount() * MultiplerFromRoundCount() * MultiplerFromMatchCount() * MultiplerFromArrowCount() * MultiplerFromRatio()  + MultiplerEloRelation() + BonusForFirstMatch())\n");
            foreach (KeyValuePair <int, GameScore> item in match.DictGameScore())
            {
                if (!(item.Value is null))
                {
                    item.Value.InfoDebug();
                    item.Value.InfoDebug2();

                    sets.AddLogs(item.Value.InfoDebug());
                    sets.AddLogs(item.Value.InfoDebug2());
                    System.Diagnostics.Debug.WriteLine(item.Value.RatioRecord + "<-RadioRecord|" + item.Value.name + "|BestShoot-> " + item.Value.BestShotFlag);
                    sets.AddLogs(item.Value.RatioRecord + "<-RadioRecord|" + item.Value.name + "|BestShoot-> " + item.Value.BestShotFlag);
                }
            }
            sets.EndLog();
        }
Example #11
0
        public List <Products> GetAllProducts()
        {
            List <Products> AllProducts = new List <Products>();

            using (ADOExecution exec = new ADOExecution(SQLBase.GetConnectionString()))
            {
                using (IDataReader dr = exec.ExecuteReader(CommandType.StoredProcedure, "GetAllProducts"))
                    while (dr.Read())
                    {
                        var Products = new Products();
                        Products.ID              = Convert.ToInt32(dr["ID"]);
                        Products.product_id      = (Convert.ToString(dr["product_id"]));
                        Products.product_name    = Convert.ToString(dr["product_name"]);
                        Products.stock_available = Convert.ToString(dr["stock_available"]);
                        AllProducts.Add(Products);
                    }
                return(AllProducts);
            }
        }
Example #12
0
        public ActionResult Notify(FormCollection coll)
        {
            LogService.LOG_LEVENL = 3;
            LogService.Error(this.GetType().ToString(), "notify parameter count:" + coll.Count);

            string alipayNotifyURL = "https://www.alipay.com/cooperate/gateway.do?service=notify_verify";
            //string alipayNotifyURL = "http://notify.alipay.com/trade/notify_query.do?";//此路径是在上面链接地址无法起作用时替换使用。
            string partner        = aliPayService.Alipay_pid; //partner合作伙伴id(必须填写)
            string key            = aliPayService.Alipay_key; //partner 的对应交易安全校验码(必须填写)
            string _input_charset = "utf-8";                  //编码类型,完全根据客户自身的项目的编码格式而定,千万不要填错。否则极其容易造成MD5加密错误。

            LogService.Error(this.GetType().ToString(), "notify_id=" + coll["notify_id"]);
            alipayNotifyURL = alipayNotifyURL + "&partner=" + partner + "&notify_id=" + coll["notify_id"];

            //获取支付宝ATN返回结果,true是正确的订单信息,false 是无效的
            string responseTxt = aliPayService.Get_Http(alipayNotifyURL, 120000);

            //*******加密签名程序开始*******
            int i;

            //Load Form variables into NameValueCollection variable.

            // Get names of all forms into a string array.
            String[] requestarr = coll.AllKeys;

            //进行排序;
            string[] Sortedstr = aliPayService.BubbleSort(requestarr);


            //构造待md5摘要字符串 ;
            StringBuilder prestr = new StringBuilder();

            for (i = 0; i < Sortedstr.Length; i++)
            {
                if (Request.Form[Sortedstr[i]] != "" && Sortedstr[i] != "sign" && Sortedstr[i] != "sign_type")
                {
                    if (i == Sortedstr.Length - 1)
                    {
                        prestr.Append(Sortedstr[i] + "=" + Request.Form[Sortedstr[i]]);
                    }
                    else
                    {
                        prestr.Append(Sortedstr[i] + "=" + Request.Form[Sortedstr[i]] + "&");
                    }
                }
            }

            prestr.Append(key);

            string mysign = aliPayService.GetMD5(prestr.ToString(), _input_charset);
            //*******加密签名程序结束*******

            string sign = Request.Form["sign"];

            LogService.Debug(this.GetType().ToString(), "responseTxt=" + responseTxt);

            if (mysign == sign && responseTxt == "true")   //验证支付发过来的消息,签名是否正确,只要成功进如这个判断里,则表示该页面已被支付宝服务器成功调用
                                                           //但判断内出现自身编写的程序相关错误导致通知给支付宝并不是发送success的消息或没有更新客户自身的数据库的情况,请自身程序编写好应对措施,否则查明原因时困难之极
            {
                LogService.LOG_LEVENL = 3;

                if (Request.Form["trade_status"] == "WAIT_BUYER_PAY")//   判断支付状态_等待买家付款(文档中有枚举表可以参考)
                {
                    //更新自己数据库的订单语句,请自己填写一下
                    string strOrderNO = Request.Form["out_trade_no"]; //订单号
                    string strPrice   = Request.Form["total_fee"];    //金额    如果你申请了商家购物卷功能,在返回信息里面请不要做金额的判断,否则会校验通过不了。

                    LogService.LOG_LEVENL = 3;

                    LogService.Debug(this.GetType().ToString(), "支付宝返回提示等待买家付款。订单号:" + strOrderNO + ";支付金额:" + strPrice);
                }
                else if (Request.Form["trade_status"] == "TRADE_FINISHED" || Request.Form["trade_status"] == "TRADE_SUCCESS")//   判断支付状态_交易成功结束(文档中有枚举表可以参考)
                {
                    //更新自己数据库的订单语句,请自己填写一下
                    string  strOrderNO = Request.Form["out_trade_no"]; //订单号
                    string  strPrice   = Request.Form["total_fee"];    //金额
                    SQLBase s          = new SQLBase();

                    string sql = "update orders set paytime='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',cash_fee=" + strPrice + ", paytype='支付宝', transaction_id='" + Request.Form["trade_no"] + "'  WHERE orderno='" + strOrderNO + "'";
                    LogService.LOG_LEVENL = 3;
                    LogService.Error(this.GetType().ToString(), sql);
                    s.ExecuteNonQuery(sql);
                }
                else
                {
                    //更新自己数据库的订单语句,请自己填写一下
                }

                Response.Write("success");     //返回给支付宝消息,成功,请不要改写这个success
                                               //success与fail及其他字符的区别在于,支付宝的服务器若遇到success时,则不再发送请求通知(即不再调用该页面,让该页面再次运行起来),
                                               //若不是success,则支付宝默认没有收到成功的信息,则会反复不停地调用该页面直到失效,有效调用时间是24小时以内。

                //最好写TXT文件,以记录下是否异步返回记录。

                ////写文本,纪录支付宝返回消息,比对md5计算结果(如网站不支持写txt文件,可改成写数据库)
                string TOEXCELLR = "支付宝回调MD5结果:mysign=" + mysign + ",sign=" + sign + ",responseTxt=" + responseTxt;
                LogService.LOG_LEVENL = 3;
                LogService.Debug(this.GetType().ToString(), TOEXCELLR);
            }
            else
            {
                Response.Write("fail");

                //最好写TXT文件,以记录下是否异步返回记录。

                //写文本,纪录支付宝返回消息,比对md5计算结果(如网站不支持写txt文件,可改成写数据库)
                LogService.LOG_LEVENL = 3;
                string TOEXCELLR = "支付宝回调MD5结果:mysign=" + mysign + ",sign=" + sign + ",responseTxt=" + responseTxt;
                LogService.Debug(this.GetType().ToString(), TOEXCELLR);
            }
            return(View());
        }
Example #13
0
 /// <summary>
 /// Instantiates the non-static sqlBase that holds the DB connection
 /// </summary>
 static SQL()
 {
     sqlBase = new SQLBase();
       sqlBase.UpdateVersion();
 }
Example #14
0
 private DBA()
 {
     sqlBase = new SQLBase();
 }
        public override void ProcessNotify()
        {
            WxPayData notifyData = GetNotifyData();

            //检查支付结果中transaction_id是否存在
            if (!notifyData.IsSet("transaction_id"))
            {
                //若transaction_id不存在,则立即返回结果给微信支付后台
                WxPayData res = new WxPayData();
                res.SetValue("return_code", "FAIL");
                res.SetValue("return_msg", "支付结果中微信订单号不存在");
                LogService.Error(this.GetType().ToString(), "The Pay result is error : " + res.ToXml());
            }

            string transaction_id = notifyData.GetValue("transaction_id") + "";

            LogService.Debug(this.GetType().ToString(), "transaction_id:" + transaction_id);
            //查询订单,判断订单真实性
            if (!QueryOrder(transaction_id))
            {
                //若订单查询失败,则立即返回结果给微信支付后台
                WxPayData res = new WxPayData();
                res.SetValue("return_code", "FAIL");
                res.SetValue("return_msg", "订单查询失败");
                LogService.Error(this.GetType().ToString(), "Order query failure : " + res.ToXml());
            }
            //查询订单成功
            else
            {
                WxPayData res = new WxPayData();
                res.SetValue("return_code", "SUCCESS");
                res.SetValue("return_msg", "OK");
                LogService.Info(this.GetType().ToString(), "order query success : " + res.ToXml());
                LogService.Info(this.GetType().ToString(), "回调信息【out_trade_no】: " + notifyData.GetValue("out_trade_no") + "; time_end:" + notifyData.GetValue("time_end") + "; cash_fee:" + notifyData.GetValue("cash_fee"));
                SQLBase s = new SQLBase();

                float fee = 0;
                try
                {
                    fee = float.Parse(notifyData.GetValue("cash_fee").ToString()) / 100.0F;
                }
                catch (Exception)
                {
                    throw;
                }
                string sql = "update order_pay set paytime='" + notifyData.GetValue("time_end") + "',cash_fee=" + fee + ",transaction_id='" + notifyData.GetValue("transaction_id") + "' WHERE orderno='" + notifyData.GetValue("out_trade_no") + "'";
                LogService.Error(this.GetType().ToString(), sql);
                s.ExecuteNonQuery(sql);

                string sql1 = "select htid,regid from order_pay WHERE orderno='" + notifyData.GetValue("out_trade_no") + "'";
                List <List <string> > listord = s.ExecuteQuery(sql1);
                if (listord.Count > 0)
                {
                    //string slq2 = "select baodan_id from ht_bd_map where hetong_id='" + listord[0][0] + "'";
                    //List<List<string>> listht = s.ExecuteQuery(slq2);
                    //if (listht.Count > 0)
                    //{
                    //    string sqlbd = "update baodan set state=5 where id='" + listht[0][0] + "' and regid='" + listord[0][1] + "'";
                    //    s.ExecuteNonQuery(sqlbd);
                    //}
                }
            }
        }
Example #16
0
 public ConsoleCommand(ref SQLBase db)
 {
     sets = new Settings(); mySqliteBase = db;
 }
Example #17
0
        //
        // GET: /Line/1209
        public ActionResult Index(int id)
        {
            string regid    = "";
            string htid     = "";
            string cpcode   = "";
            string username = "";

            htid             = id.ToString();
            ViewData["htid"] = htid;
            //htid = "9421";
            try
            {
                string regid1 = Session["regid"].ToString();
                //string regid1 = "77426";
                if (string.IsNullOrEmpty(regid1))
                {
                    Response.Redirect("http://www.youxuewang.com.cn");
                }
                else
                {
                    regid = Session["regid"].ToString();
                }
                username = Session["username"].ToString();
                LogService.Debug("用户id和用户账户:", regid + "," + username);
            }
            catch (Exception)
            {
            }

            Ht_version        ht   = new Ht_version();
            List <Ht_version> list = ht.Select("where id='" + htid + "'");

            if (list.Count > 0)
            {
                ViewBag.Version = list;
                if (!string.IsNullOrEmpty(list[0].cpno))
                {
                    cpcode = list[0].cpno;
                }
            }

            #region 处理特殊情况下的支付
            //Ht_version ht1 = new Ht_version();
            //List<Ht_version> list1 = ht1.Select("where id='" + htid + "'");
            //if(list1.Count>0)
            //{
            //    ViewBag.Chengren = list1[0].adultprice;
            //    ViewBag.Student = list1[0].studentprice;
            //}


            //ht_bmzf bmzf = new ht_bmzf();
            //List<ht_bmzf> listzf = bmzf.Select("where regid='"+regid+"'");
            //if(listzf.Count>0)
            //{
            //    if (listzf[0].flag == 0)
            //    {
            //        ViewData["flag"] = "(余款)";
            //    }
            //    else
            //    {
            //        ViewData["flag"] = "(全款)";
            //    }
            //}
            #endregion

            SQLBase sb    = new SQLBase();
            string  sqlad = "select * from Ht_version v left join ht_bd_map h on v.id=h.hetong_id left join Baodan b on h.baodan_id=b.id where b.regid='" + regid + "' and v.id='" + htid + "' and ischild=1";
            List <List <string> > listbd = sb.ExecuteQuery(sqlad);

            string sqlstu = "select * from Ht_version v left join ht_bd_map h on v.id=h.hetong_id left join Baodan b on h.baodan_id=b.id where b.regid='" + regid + "' and v.id='" + htid + "' and ischild=0";
            List <List <string> > listbd1 = sb.ExecuteQuery(sqlstu);

            int count  = listbd.Count;
            int count1 = listbd1.Count;
            //int count = 1;
            //int count1 = 0;
            if (listbd1.Count > 0)
            {
                ViewBag.Baodan1 = count1;
            }
            if (listbd.Count > 0)
            {
                ViewBag.Baodan = count;
            }

            //支付信息确认
            SQLBase sqlbase  = new SQLBase();
            string  sqlquery = "select r.truename,o.name from RegisterPresonal r left join org o on r.orgid=o.id where r.id='" + regid + "'";
            List <List <string> > listreg = sqlbase.ExecuteQuery(sqlquery);
            if (listreg.Count > 0)
            {
                ViewData["username"]  = listreg[0][0];
                ViewData["classname"] = listreg[0][1];
            }

            return(View(""));
        }