Exemple #1
0
 /// <summary>
 /// 页面加载事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     try {
         if (!IsPostBack)
         {
             if (Session["OpenIdE"] == null)
             {
                 if (!string.IsNullOrEmpty(Request.QueryString["code"]))
                 {
                     string  code      = Convert.ToString(Request.QueryString["code"]);
                     string  returnStr = getOpenId(code);
                     JObject json      = JObject.Parse(returnStr);
                     openId             = json["openid"].ToString();
                     Session["OpenIdE"] = openId;
                     string DeviceId = QrChildManager.GetChildDeviceId(openId);
                     Session["DeviceId"] = DeviceId;
                     List <AlarmClocks> mis = AlarmClocksLogic.Instance().GetAlarmClock(DeviceId);
                     RpList.DataSource = mis;
                     RpList.DataBind();
                 }
             }
             else if (Session["OpenIdE"] != null)
             {
                 openId = Session["OpenIdE"].ToString();                    //得到OpenId
                 string DeviceId = QrChildManager.GetChildDeviceId(openId); //得到token
                 if (DeviceId != "" || DeviceId != null)
                 {
                     Session["DeviceId"] = DeviceId;
                     if (DeviceId.Length != 0)
                     {
                         List <AlarmClocks> Almc = AlarmClocksLogic.Instance().GetAlarmClock(DeviceId);
                         RpList.DataSource = Almc;
                         RpList.DataBind();
                     }
                 }
             }
         }
         string             deviceId = Session["DeviceId"].ToString();
         List <AlarmClocks> miss     = AlarmClocksLogic.Instance().GetAlarmClock(deviceId);
         RpList.DataSource = miss;
         RpList.DataBind();
     } catch (Exception ex) {
         // Response.Write(" <script type=\"text/javascript\"> alert(\"登录过期,请重新登录\");</script>");
         Response.Write(" <script type=\"text/javascript\"> alert(\"登录过期,请重新进入\");</script>");
         //Response.Write(" <script type=\"text/javascript\"> window.close(); </script>");
         //Response.Write(" <script type=\"text/javascript\">history.go(-2);</script>");
     }
 }
    private void Getdata()
    {
        string strConnstr = ConfigurationManager.AppSettings["ConnectionString_POS"];
        Dbconn conn       = new Dbconn(strConnstr, true);

        string strPhone = this.txtPhone.Text;

        if (strPhone.Trim() != "")
        {
            string strName = conn.GetDataTableFirstValue(@"SELECT vipname as 姓名, mobtel as 手机号, vipcode as 卡号 FROM vip_user WHERE mobtel=@Param0 OR vipcode=@Param0", new string[] { strPhone }).ToString();
            this.lblName.Text = strName;

            DataSet ds = conn.GetDataSet(@"SELECT  b.ticketid AS 券号 ,
                                                a.sums AS 面值 ,
                                                CASE ISNULL(b.getsure,0)WHEN 0 THEN '否' ELSE '是' END  AS 是否使用 ,
                                                b.crdate AS 创建日期 ,
                                                b.verifycode AS 验证码,a.mobtel, a.vipcode, a.vipid

                                        FROM    vip_user a
                                                INNER JOIN vip_ticket b ON a.vipid = b.vipid
                                        WHERE   b.tictypeid = '31'
                                        AND (a.mobtel=@param0 OR a.vipcode=@param0)
                                        ORDER BY b.crdate DESC
                                        ", new string[] { strPhone });
            RpList.DataSource = ds.Tables[0];
            RpList.DataBind();

            if (ds.Tables[0].Rows.Count == 0)
            {
                this.lblMessage.Text = "<font color='red'>没有查询到手机号/卡号为" + strPhone + "的相关信息,请重试</font>";
            }
            else
            {
                this.lblMessage.Text = "";
            }
        }
        else
        {
            this.lblMessage.Text = "";

            RpList.DataSource = new DataTable();
            RpList.DataBind();
        }
    }
        /// <summary>
        /// 绑定收款单据列表数据
        /// </summary>
        private void BindRpList()
        {
            double zje = 0;

            if (Session["login"] == null)
            {
                Response.Redirect("~/Login.aspx", true);
            }
            else
            {
                LoginInfo login = Session["login"] as LoginInfo;

                AspNetPager1.RecordCount = To_CollectingManager.GetTotalCount(FilterSql, login.Id);

                SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 019);
                if (sps == null)
                {
                    AspNetPager1.NumericButtonCount = 5;
                    AspNetPager1.PageSize           = 5;
                }
                else
                {
                    AspNetPager1.NumericButtonCount = sps.Pagecount;
                    AspNetPager1.PageSize           = sps.Pageitem;
                }
                if (HttpContext.Current.Request.QueryString["page"] != null)
                {
                    AspNetPager1.CurrentPageIndex = int.Parse(HttpContext.Current.Request.QueryString["page"]);
                }

                collectingList = To_CollectingManager.GetListByPage(FilterSql, login.Id, AspNetPager1.StartRecordIndex, AspNetPager1.EndRecordIndex);
                //5.31 增加总计的计算
                if (collectingList.Count > 0 && collectingList != null)
                {
                    foreach (To_Collecting cl in collectingList)
                    {
                        zje += cl.ReceiptAmount.ToString() == "" ? 0.00 : Convert.ToDouble(cl.ReceiptAmount.ToString());
                    }
                }
                RpList.DataSource = collectingList;
                RpList.DataBind();
                this.zje.Text = "¥" + zje.ToString("0.00");
            }
        }
Exemple #4
0
        /// <summary>
        /// 绑定收款单据列表数据
        /// </summary>
        private void BindRpList()
        {
            LoginInfo login = Session["login"] as LoginInfo;

            AspNetPager1.RecordCount = To_CollectingManager.GetTotalCountByLimit(FilterSql + " AND confirmReceipt=1 ", login.Id);

            SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 018);

            if (sps == null)
            {
                AspNetPager1.NumericButtonCount = 5;
                AspNetPager1.PageSize           = 5;
            }
            else
            {
                AspNetPager1.NumericButtonCount = sps.Pagecount;
                AspNetPager1.PageSize           = sps.Pageitem;
            }

            DataTable data = To_CollectingManager.GetListByLimit(FilterSql + " AND confirmReceipt=1 ", login.Id, AspNetPager1.StartRecordIndex, AspNetPager1.EndRecordIndex);

            RpList.DataSource = data;
            RpList.DataBind();
        }