示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            VerifyPage("", true);
            if (!IsPostBack)
            {
                var spid = Request.QueryString["spid"];

                if (!string.IsNullOrEmpty(spid))
                {
                    #region 左侧分类

                    var itid = Request.QueryString["itid"]; //分类id
                    if (!string.IsNullOrEmpty(itid))
                    {
                        var model = _infoTypeDal.GetModel(Convert.ToInt32(itid));
                        if (null != model)
                        {
                            litType.Text = Service.GetType(Convert.ToInt32(model.ITID), spid);
                        }
                    }
                    else
                    {
                        litType.Text = Service.GetType(0, spid);
                    }

                    #endregion

                    #region 块内容

                    var tiid = Request.QueryString["tiid"];
                    if (!string.IsNullOrEmpty(tiid))
                    {
                        TempInfo _tempInfoDal = new TempInfo();
                        var      timodel      = _tempInfoDal.GetModel(Convert.ToInt32(tiid));
                        if (null != timodel)
                        {
                            #region 导航
                            litStaName.Text = Service.Nav(timodel, Request.QueryString["spid"], Request.QueryString["itid"]);
                            #endregion

                            #region 分页
                            var newpage = "";
                            litPager.Text   = Service.Pager(timodel, Request.QueryString["spid"], Request.QueryString["itid"], out newpage);
                            litNewPage.Text = newpage;
                            #endregion

                            litInfo1.Text = Service.GetBtn(timodel, 1, Request.QueryString["spid"], Request.QueryString["itid"]);
                            litInfo2.Text = Service.GetBtn(timodel, 2, Request.QueryString["spid"], Request.QueryString["itid"]);
                            litInfo3.Text = Service.GetBtn(timodel, 3, Request.QueryString["spid"], Request.QueryString["itid"]);
                            litInfo4.Text = Service.GetBtn(timodel, 4, Request.QueryString["spid"], Request.QueryString["itid"]);
                            litInfo5.Text = Service.GetBtn(timodel, 5, Request.QueryString["spid"], Request.QueryString["itid"]);
                            litInfo6.Text = Service.GetBtnNoSpace(timodel, 6, Request.QueryString["spid"], Request.QueryString["itid"]);
                            litInfo7.Text = Service.GetBtnNoSpace(timodel, 7, Request.QueryString["spid"], Request.QueryString["itid"]);
                        }
                    }

                    #endregion
                }
            }
        }
示例#2
0
        private async void History_Load(object sender, EventArgs e)
        {
            limitsCB.SelectedItem = "100";
            chart1.Series.Add("Tempeture");
            chart1.Series.Add("Humiditiy");
            chart1.Series.Add("IsAlarm");
            table.Columns.Add("Time", typeof(string));
            table.Columns.Add("Temp", typeof(float));
            table.Columns.Add("Hum", typeof(float));
            table.Columns.Add("IsAlarm", typeof(bool));
            dataGridView1.ReadOnly   = true;
            dataGridView1.DataSource = table;
            dataGridView1.Sort(dataGridView1.Columns["time"], ListSortDirection.Descending);
            chart1.Series[0].ChartType = SeriesChartType.FastLine;
            chart1.Series[1].ChartType = SeriesChartType.FastLine;

            //chart1.Series[0].Points.DataBindXY(x, y);



            Query         capitalQuery         = Program.db.Collection(MainFRM.COLLECTION_NAME).OrderByDescending("WhenUNIX").Limit(100);
            QuerySnapshot capitalQuerySnapshot = await capitalQuery.GetSnapshotAsync();

            foreach (DocumentSnapshot documentSnapshot in capitalQuerySnapshot.Documents)
            {
                TempInfo temp = documentSnapshot.ConvertTo <TempInfo>();

                if (RBalarmOn.Checked)
                {
                    if (temp.IsAlarmed)
                    {
                        table.Rows.Add(temp.WhenString, temp.Temperature, temp.Humidity, temp.IsAlarmed);
                    }
                }
                else if (RBalarmOff.Checked)
                {
                    if (!temp.IsAlarmed)
                    {
                        table.Rows.Add(temp.WhenString, temp.Temperature, temp.Humidity, temp.IsAlarmed);
                    }
                }
                else
                {
                    table.Rows.Add(temp.WhenString, temp.Temperature, temp.Humidity, temp.IsAlarmed);
                }
            }
            DataView dv = table.DefaultView;

            dv.Sort   = "Time";
            SortTable = dv.ToTable();
            x         = SortTable.Rows.OfType <DataRow>().Select(dr => dr.Field <string>("Time")).ToList();
            yTemp     = SortTable.Rows.OfType <DataRow>().Select(dr => dr.Field <float>("Temp")).ToList();
            yHum      = SortTable.Rows.OfType <DataRow>().Select(dr => dr.Field <float>("Hum")).ToList();
            IsAl      = SortTable.Rows.OfType <DataRow>().Select(dr => dr.Field <bool>("IsAlarm")).ToList();


            chart1.Series[0].Points.DataBindXY(x, yTemp);
            chart1.Series[1].Points.DataBindXY(x, yHum);
            dataGridView1.AutoResizeColumns();
        }
 /// <summary>
 /// Print errors
 /// </summary>
 // -----------------------------------------------------------------------------------------------
 protected void printErrorIfInitFailed(TempInfo tempInfo)
 {
     if (!tempInfo.oriTextAsset)
     {
         Debug.LogError("Not found : " + tempInfo.oriTextAssetPath);
     }
 }
        /// <summary>
        /// 删除模板
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public ActionResult Delete(string name)
        {
            string   result = "";
            TempInfo ti     = new TempInfo(name);

            Common.FileHelper.DeleteFile(ti.Path);
            result = "ok";
            return(Content(result));
        }
        // -----------------------------------------------------------------------------------------------
        protected void copyTextAsset(TempInfo tempInfo, string folderPathToCopy)
        {
            if (!tempInfo.oriTextAsset)
            {
                Debug.LogError("Empty TextAsset : " + tempInfo.oriTextAssetPath);
                return;
            }

            // -------------------------------

            string copyTargetPath = folderPathToCopy + "/" + tempInfo.newClassName + ".cs";

            if (File.Exists(copyTargetPath))
            {
                if (!this.m_overwriteYesTAll)
                {
                    int val = EditorUtility.DisplayDialogComplex("Confirmation", "Overwrite ?\n\n" + copyTargetPath, "Yes", "No", "Yes to All");

                    if (val == 1)
                    {
                        return;
                    }

                    else if (val == 2)
                    {
                        this.m_overwriteYesTAll = true;
                    }
                }
            }

            // WriteAllText
            {
                try
                {
                    string text = tempInfo.oriTextAsset.text;

                    text = text.Replace("#NAMESPACE#", this.m_namespace);

                    text = text.Replace("#CLASSNAME#", tempInfo.newClassName);

                    File.WriteAllText(copyTargetPath, text);
                }

                catch (Exception e)
                {
                    Debug.LogError(e.Message);
                }
            }
        }
示例#6
0
        private async Task CreateSetsAsync(string message)
        {
            var firstTemp = await js.DeserializeObjectAsync <CustomBasicList <string> >(message);

            foreach (var thisFirst in firstTemp)
            {
                var thisSend = await js.DeserializeObjectAsync <SendCreateSet>(thisFirst);

                var      thisCol  = thisSend.CardList.GetObjectsFromList(SingleInfo !.MainHandList);
                TempInfo thisTemp = new TempInfo();
                thisTemp.CardList = thisCol;
                thisTemp.WhatSet  = thisSend.WhatSet;
                await CreateNewSetAsync(thisTemp, true);
            }
        }
        public ActionResult Edit(TempInfo ti, string content)
        {
            bool result = false;

            try
            {
                if (Common.FileHelper.IsFileExists(ti.Path))
                {
                    Common.FileHelper.DeleteFile(ti.Path);
                }
                Common.FileHelper.WriteFile(ti.Path, content);
                result = true;
                return(result ? Content(BaseController.ContentIcon.Succeed + "|操作成功|/Manager/TempleManager/Index") : Content(BaseController.ContentIcon.Error + "|操作失败"));
            }
            catch (Exception ex)
            {
                return(Content(BaseController.ContentIcon.Error + "|" + ex.Message));
            }
        }
        //
        // GET: /Manager/TempleManager/


        /// <summary>
        /// 模板列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public ActionResult Index(int?pageIndex, int?pageSize)
        {
            var             filePath = Web.Areas.Manager.Helper.PathHelper.Templepath + "temp1\\";
            var             fileList = Common.DirHelper.GetFiles(filePath);
            List <TempInfo> tlts     = new List <TempInfo>();

            foreach (var item in fileList)
            {
                var tempStr = filePath + item.ToString();
                tempStr = tempStr.Substring(tempStr.LastIndexOf("\\") + 1);
                tempStr = tempStr.Substring(0, tempStr.LastIndexOf("."));
                TempInfo ti = new TempInfo(tempStr, filePath + item.ToString());
                tlts.Add(ti);
            }
            if (Request.IsAjaxRequest())
            {
                return(PartialView("_Index", tlts.ToPagedList(pageIndex ?? 1, pageSize ?? 10)));
            }
            return(View(tlts.ToPagedList(pageIndex ?? 1, pageSize ?? 10)));
        }
示例#9
0
        public async Task CreateNewSetAsync(TempInfo thisTemp, bool isInit)
        {
            if (thisTemp.CardList.Count == 0)
            {
                throw new BasicBlankException("There must be at least one tile in order to create a new set");
            }
            if (thisTemp.WhatSet == EnumWhatSets.Runs)
            {
                thisTemp.CardList.Sort(); //hopefully that will work (?)
                var firstTile = thisTemp.CardList.First();
                var lastTile  = thisTemp.CardList.Last();
                if (firstTile.IsJoker)
                {
                    firstTile.Number = thisTemp.FirstNumber;
                }
                if (lastTile.IsJoker)
                {
                    lastTile.Number = thisTemp.SecondNumber;
                }
            }
            thisTemp.CardList.ForEach(thisTile =>
            {
                if (thisTile.WhatDraw != EnumDrawType.FromSet)
                {
                    thisTile.WhatDraw = EnumDrawType.FromHand;
                }
                thisTile.IsSelected = false;
                thisTile.Drew       = true;
            });
            TileSet thisSet = new TileSet(_command, _rummys);

            thisSet.CreateSet(thisTemp.CardList, thisTemp.WhatSet);
            _model !.MainSets1 !.CreateNewSet(thisSet);
            if (isInit == false)
            {
                SaveRoot !.DidExpand = true;
                await ContinueTurnAsync();
            }
        }
示例#10
0
        public bool HasInitialSets(out CustomBasicList <TempInfo> newList)
        {
            IDeckDict <TileInfo>       tempCollection; //hopefully still works (?)
            DeckRegularDict <TileInfo> thisCollection;

            newList = new CustomBasicList <TempInfo>();
            int totalPoints = 0;

            for (int x = 1; x <= 4; x++)
            {
                tempCollection = WhatSet(x);
                thisCollection = new DeckRegularDict <TileInfo>();
                if (tempCollection.Count > 0)
                {
                    thisCollection.AddRange(tempCollection);
                }
                if (HasValidSet(thisCollection, out int firsts, out int seconds))
                {
                    TempInfo thisTemp = new TempInfo();
                    thisTemp.CardList = thisCollection;
                    totalPoints      += thisTemp.CardList.Sum(items => items.Points);
                    thisTemp.TempSet  = x;
                    if (firsts == -1)
                    {
                        thisTemp.WhatSet = EnumWhatSets.Kinds;
                    }
                    else
                    {
                        thisTemp.WhatSet      = EnumWhatSets.Runs;
                        thisTemp.FirstNumber  = firsts;
                        thisTemp.SecondNumber = seconds;
                    }
                    newList.Add(thisTemp);
                }
            }
            return(totalPoints >= 30); //brenden said the total points has to be 30 or over for the initial sets.
        }
示例#11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            VerifyPage("", true);
            if (!IsPostBack)
            {
                var spid = Request.QueryString["spid"];

                if (!string.IsNullOrEmpty(spid))
                {
                    #region 左侧分类

                    var itid = Request.QueryString["itid"]; //分类id
                    if (!string.IsNullOrEmpty(itid))
                    {
                        var model = _infoTypeDal.GetModel(Convert.ToInt32(itid));
                        if (null != model)
                        {
                            litType.Text = Service.GetType(Convert.ToInt32(model.ITID), spid);
                        }
                    }
                    else
                    {
                        litType.Text = Service.GetType(0, spid);
                    }

                    #endregion

                    #region 块内容

                    var tiid = Request.QueryString["tiid"];
                    if (!string.IsNullOrEmpty(tiid))
                    {
                        TempInfo _tempInfoDal = new TempInfo();
                        var      timodel      = _tempInfoDal.GetModel(Convert.ToInt32(tiid));
                        if (null != timodel)
                        {
                            #region 导航

                            var ptiid = Request.QueryString["ptiid"];
                            if (!string.IsNullOrEmpty(ptiid))
                            {
                                litStaName.Text = "<div class=\"backup\"><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid + "&itid=" + Request.QueryString["itid"] +
                                                  "\" class=\"back_btn backfirst\">返回首页</a><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid +
                                                  "&tiid=" + ptiid + "&itid=" + Request.QueryString["itid"] +
                                                  "\" class=\"back_btn\">返回上级</a> </div>";
                            }
                            else
                            {
                                #region 分站名称

                                StaPackage  _staPackageDal  = new StaPackage();
                                OrgOrganize _orgOrganizeDal = new OrgOrganize();
                                var         spmodel         = _staPackageDal.GetModel(Convert.ToInt32(spid));
                                if (null != spmodel)
                                {
                                    var orgmodel = _orgOrganizeDal.GetModel(Convert.ToInt64(spmodel.OrgId));
                                    if (null != orgmodel)
                                    {
                                        litStaName.Text =
                                            "<div class=\"logo\"><img src=\"/images/LOGO-yt.png\" style=\"display: block; width: 50px; height: 50px;\" alt=\"沿途\" /></div><div class=\"title\"><strong>" +
                                            orgmodel.OrgName + "</strong><span>" + orgmodel.EnName + "</span></div>";
                                    }
                                }

                                #endregion
                            }

                            #endregion

                            #region 分页

                            litPager.Text = "<td><input type=\"button\" class=\"btn btn-sm delpage\" value=\"删除\" style=\"width: 50px;\" /></td>";;

                            #endregion

                            #region

                            var sortNum = 1;
                            List <SqlParameter> par1 = new List <SqlParameter>();
                            var tmpPar1 =
                                _templateParDal.GetModel(" TID=" + timodel.TID + " and SortNum=" + sortNum + " ", par1);

                            var info1 = _infosDal.GetModel(" TIID=" + timodel.TIID + " and SortNum=" + sortNum + " ",
                                                           par1);
                            if (null != info1)
                            {
                                var user = (OrgUsers)HttpContext.Current.Session["CurrentUser"];
                                #region 纯图广告反显

                                if (info1.IType == 7)
                                {
                                    #region 右侧推荐

                                    litInfo1.Text += "<div class=\"txtbox tmenu\"><ul>";
                                    List <SqlParameter> par = new List <SqlParameter>();
                                    par.Add(new SqlParameter("@IID", DbType.AnsiString)
                                    {
                                        Value = info1.IID
                                    });
                                    var dt = _adInfosDal.GetListAI(" AdInfos.IID=@IID ", par).Tables[0];
                                    if (dt.Rows.Count > 0)
                                    {
                                        if (dt.Rows.Count < 6)
                                        {
                                            litInfo1.Text +=
                                                "<li class=\"tit\"><span class=\"btn btnadd add-rec\" data-iid=\"" +
                                                info1.IID +
                                                "\">添加推荐</span> </li>";
                                        }
                                        else
                                        {
                                            litInfo1.Text += "<li class=\"tit\"></li>";
                                        }
                                        for (int i = 0; i < dt.Rows.Count; i++)
                                        {
                                            litInfo1.Text +=
                                                "<li title=\"" +
                                                dt.Rows[i]["IName"] + "\"><span class=\"del del-rec\"  data-aiid=\"" +
                                                dt.Rows[i]["AIID"] +
                                                "\">删除</span><a href=\"/Manage/Template/Redircet.aspx?spid=" +
                                                Request.QueryString["spid"] + "&pid=" + dt.Rows[i]["Inf_IID"] +
                                                "&itid=" +
                                                Request.QueryString["itid"] + "\"><span class=\"hot\"></span>" +
                                                (dt.Rows[i]["IName"].ToString().Length > 12
                                                    ? dt.Rows[i]["IName"].ToString().Substring(0, 12) + "..."
                                                    : dt.Rows[i]["IName"].ToString()) + "</a></li>";
                                        }
                                    }
                                    else
                                    {
                                        litInfo1.Text +=
                                            "<li class=\"tit\"><span class=\"btn btnadd add-rec\" data-iid=\"" +
                                            info1.IID +
                                            "\">添加推荐</span> </li>";
                                    }
                                    litInfo1.Text += " </ul></div>";
                                    #endregion


                                    litInfo1.Text +=
                                        "<div class=\"btnbox\" style=\"top:54%;right:10%;display:none\"><a href=\"javascript:;\" class=\"btn edit-info\" data-iid=\"" +
                                        info1.IID + "\" data-sortnum=\"" + sortNum +
                                        "\" data-bgw=\"" + tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                        "\">编辑</a> <a href=\"javascript:;\" class=\"btn del-info\" data-iid=\"" +
                                        info1.IID +
                                        "\" data-sortnum=\"" + sortNum +
                                        "\" data-bgw=\"" + tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                        "\">删除</a>";
                                    if (1 == user.Type)
                                    {
                                        if (1 == info1.Status)
                                        {
                                            litInfo1.Text += " <a href=\"javascript:;\" class=\"btn sin-info btn-warning\" data-iid=\"" +
                                                             info1.IID +
                                                             "\">标记</a>";
                                        }
                                        else
                                        {
                                            litInfo1.Text += " <a href=\"javascript:;\" class=\"btn sin-info btn-warning\" data-iid=\"" +
                                                             info1.IID +
                                                             "\">取消标记</a>";
                                        }
                                    }
                                    else
                                    {
                                        if (0 == info1.Status)
                                        {
                                            litInfo1.Text += " <span class=\"btn btn-editing\">待修改</span>";
                                        }
                                    }
                                    litInfo1.Text += "</div><img style=\"height: 606px; display: block; width: 756px;\" src=\"/UploadFiles/" + info1.PicAttID + "\">";
                                }

                                #endregion
                            }
                            else
                            {
                                litInfo1.Text =
                                    "<div class=\"btnbox\"><a href=\"javascript:;\" class=\"btn new-info\" data-sortnum=\"" +
                                    sortNum +
                                    "\" data-bgw=\"" + tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                    "\">新增</a>";
                                //litInfo1.Text += " <a href=\"javascript:;\" class=\"btn select-info\" data-sortnum=\"" +
                                //    sortNum +
                                //    "\">选择</a>";
                                litInfo1.Text += "</div><img>";
                            }

                            #endregion
                        }
                    }

                    #endregion
                }
            }
        }
        /// <summary>
        /// 创建模板
        /// </summary>
        /// <returns></returns>
        public ActionResult Create()
        {
            TempInfo ti = new TempInfo();

            return(View(ti));
        }
示例#13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            VerifyPage("", true);
            if (!IsPostBack)
            {
                var spid = Request.QueryString["spid"];

                if (!string.IsNullOrEmpty(spid))
                {
                    #region 左侧分类

                    var itid = Request.QueryString["itid"]; //分类id
                    if (!string.IsNullOrEmpty(itid))
                    {
                        var model = _infoTypeDal.GetModel(Convert.ToInt32(itid));
                        if (null != model)
                        {
                            litType.Text = Service.GetType(Convert.ToInt32(model.ITID), spid);
                        }
                    }
                    else
                    {
                        litType.Text = Service.GetType(0, spid);
                    }

                    #endregion

                    #region 块内容

                    var tiid = Request.QueryString["tiid"];
                    if (!string.IsNullOrEmpty(tiid))
                    {
                        TempInfo _tempInfoDal = new TempInfo();
                        var      timodel      = _tempInfoDal.GetModel(Convert.ToInt32(tiid));
                        if (null != timodel)
                        {
                            #region 导航

                            var ptiid = Request.QueryString["ptiid"];
                            if (!string.IsNullOrEmpty(ptiid))
                            {
                                litStaName.Text = "<div  class=\"backup\"><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid + "&itid=" + Request.QueryString["itid"] +
                                                  "\" class=\"back_btn backfirst\">返回首页</a><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid +
                                                  "&tiid=" + ptiid + "&itid=" + Request.QueryString["itid"] +
                                                  "\" class=\"back_btn\">返回上级</a> </div>";
                            }
                            else
                            {
                                #region 分站名称

                                StaPackage  _staPackageDal  = new StaPackage();
                                OrgOrganize _orgOrganizeDal = new OrgOrganize();
                                var         spmodel         = _staPackageDal.GetModel(Convert.ToInt32(spid));
                                if (null != spmodel)
                                {
                                    var orgmodel = _orgOrganizeDal.GetModel(Convert.ToInt64(spmodel.OrgId));
                                    if (null != orgmodel)
                                    {
                                        litStaName.Text =
                                            "<div class=\"logo\"><img src=\"/images/LOGO-yt.png\" style=\"display: block; width: 50px; height: 50px;\" alt=\"沿途\" /></div><div class=\"title\"><strong>" +
                                            orgmodel.OrgName + "</strong><span>" + orgmodel.EnName + "</span></div>";
                                    }
                                }

                                #endregion
                            }

                            #endregion

                            #region 分页

                            litPager.Text = "<td><input type=\"button\" class=\"btn btn-sm delpage\" value=\"删除\" style=\"width: 50px;\" /></td>";;

                            #endregion

                            litInfo1.Text = GetBtn(timodel, 1);
                        }
                    }

                    #endregion
                }
            }
        }
示例#14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            VerifyPage("", true);
            if (!IsPostBack)
            {
                var spid = Request.QueryString["spid"];

                if (!string.IsNullOrEmpty(spid))
                {
                    #region 左侧分类

                    var itid = Request.QueryString["itid"]; //分类id
                    if (!string.IsNullOrEmpty(itid))
                    {
                        var model = _infoTypeDal.GetModel(Convert.ToInt32(itid));
                        if (null != model)
                        {
                            litType.Text = Service.GetType(Convert.ToInt32(model.ITID), spid);
                        }
                    }
                    else
                    {
                        litType.Text = Service.GetType(0, spid);
                    }

                    #endregion

                    #region 块内容

                    var tiid = Request.QueryString["tiid"];
                    if (!string.IsNullOrEmpty(tiid))
                    {
                        TempInfo _tempInfoDal = new TempInfo();
                        var      timodel      = _tempInfoDal.GetModel(Convert.ToInt32(tiid));
                        if (null != timodel)
                        {
                            #region 导航

                            if (0 != timodel.ParentID)
                            {
                                var imodel = infosDal.GetModel(Convert.ToInt32(timodel.ParentID));
                                if (null != imodel)
                                {
                                    litStaName.Text = "<div  class=\"backup\"><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid + "&itid=" + Request.QueryString["itid"] +
                                                      "\" class=\"back_btn backfirst\">返回首页</a><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid +
                                                      "&tiid=" + imodel.TIID + "&itid=" + Request.QueryString["itid"] +
                                                      "\" class=\"back_btn\">返回上级</a> </div>";
                                }
                            }
                            else
                            {
                                #region 分站名称

                                StaPackage  _staPackageDal  = new StaPackage();
                                OrgOrganize _orgOrganizeDal = new OrgOrganize();
                                var         spmodel         = _staPackageDal.GetModel(Convert.ToInt32(spid));
                                if (null != spmodel)
                                {
                                    var orgmodel = _orgOrganizeDal.GetModel(Convert.ToInt64(spmodel.OrgId));
                                    if (null != orgmodel)
                                    {
                                        litStaName.Text =
                                            "<div class=\"logo\"><img src=\"/images/LOGO-yt.png\" style=\"display: block; width: 50px; height: 50px;\" alt=\"沿途\" /></div><div class=\"title\"><strong>" +
                                            orgmodel.OrgName + "</strong><span>" + orgmodel.EnName + "</span></div>";
                                    }
                                }

                                #endregion
                            }

                            #endregion

                            #region 分页

                            var pager = "";
                            List <SqlParameter> parDef = new List <SqlParameter>();
                            var preitModel             =
                                _tempInfoDal.GetModel(
                                    " ITID=" + timodel.ITID + " and ParentID=" + timodel.ParentID + " and TIPage=" +
                                    (timodel.TIPage - 1), parDef);
                            if (null != preitModel)
                            {
                                pager += "<td><a href=\"/Manage/Template/Redircet.aspx?itid=" +
                                         Request.QueryString["itid"] + "&spid=" + Request.QueryString["spid"] + "&tiid=" +
                                         preitModel.TIID + "\" class=\"btn btnprev\" data-tiid=\"" + preitModel.TIID +
                                         "\">上页 </a></td>";
                            }
                            else
                            {
                                pager += "<td>&nbsp;</td>";
                            }
                            var count =
                                _tempInfoDal.GetList(" TIPage is not null and TIPage!='' and ITID=" + timodel.ITID + " and ParentID=" + timodel.ParentID,
                                                     parDef).Tables[0].Rows.Count;
                            if (count > 1)
                            {
                                pager +=
                                    "<td>页码 </td><td><input type=\"text\" class=\"form-control input-sm iptpno\" value=\"" +
                                    timodel.TIPage +
                                    "\" style=\"width: 40px;display:inline;text-align: center;\" /> /" + count + "</td><td><input data-parcount=\"" + timodel.ParentID + "\" data-count=\"" + count + "\" type=\"button\" class=\"btn btn-sm repage\" value=\"跳转\" style=\"width: 70px;\" /></td><td><input type=\"button\" class=\"btn btn-sm editpno\" value=\"修改页码\" style=\"width: 70px;\" /></td><td><input type=\"button\" class=\"btn btn-sm delpage\" value=\"删除当前页\" /></td>";
                            }
                            else if (count == 1)
                            {
                                pager +=
                                    "<td><input type=\"button\" class=\"btn btn-sm delpage\" value=\"删除当前页\" /></td>";
                            }
                            var nexitModel =
                                _tempInfoDal.GetModel(
                                    " ITID=" + timodel.ITID + " and ParentID=" + timodel.ParentID + " and TIPage=" +
                                    (timodel.TIPage + 1), parDef);
                            if (null != nexitModel)
                            {
                                pager += "<td><a href=\"/Manage/Template/Redircet.aspx?itid=" +
                                         Request.QueryString["itid"] + "&spid=" + Request.QueryString["spid"] + "&tiid=" +
                                         nexitModel.TIID + "\" class=\"btn btnnext\" data-tiid=\"" +
                                         nexitModel.TIID + "\">下页 </a></td>";
                            }
                            else
                            {
                                pager          += "<td>&nbsp;</td>";
                                litNewPage.Text = "<a href=\"/Manage/Systems/ChooseNewsTemplate.aspx?page=" +
                                                  (timodel.TIPage + 1) + "&pid=" + timodel.ParentID + "&itid=" +
                                                  Request.QueryString["itid"] + "&spid=" + Request.QueryString["spid"] +
                                                  "&tiid=" + timodel.TIID + "\" class=\" btn btn-add newpage\">新建内容页</a> <a href=\"/Manage/News/RedircetAD.aspx?itid=" +
                                                  Request.QueryString["itid"] + "&spid=" + Request.QueryString["spid"] + "&tiid=" +
                                                  timodel.TIID + "\" class=\"btn btn-add newpage\" style=\"top:50%\">添加文末广告</a>";
                            }
                            litPager.Text = pager;

                            #endregion

                            List <SqlParameter> par1 = new List <SqlParameter>();
                            var tmpPar1 = templateParDal.GetModel(" TID=" + timodel.TID + " and SortNum=1 ", par1);

                            var str    = "<div class=\"box col-sm-12 ht2\" style=\"text-align:inherit\">";
                            var dtInfo = infosDal.GetList(" TIID=" + timodel.TIID, par1).Tables[0];
                            if (dtInfo.Rows.Count > 0)
                            {
                                for (int i = 0; i < dtInfo.Rows.Count; i++)
                                {
                                    var point = "/images/hand.png";
                                    if ("" != dtInfo.Rows[i]["ADPic"].ToString())
                                    {
                                        point = "/UploadFiles/" + dtInfo.Rows[i]["ADPic"];
                                    }
                                    str +=
                                        "<div class=\"news-pic\" style=\"top:" + dtInfo.Rows[i]["YPosition"] +
                                        "px;left:" + dtInfo.Rows[i]["XPosition"] +
                                        "px;\"><a href=\"javascript:;\" data-iid=\"" + dtInfo.Rows[i]["IID"] +
                                        "\" class=\"btn edit-pic\">编辑</a> <a href=\"javascript:;\" data-iid=\"" +
                                        dtInfo.Rows[i]["IID"] +
                                        "\" class=\"btn del-pic\">删除</a><img src=\"" + point + "\" style=\"background-color:transparent\"/></div>";
                                }
                                if (dtInfo.Rows.Count < 4)
                                {
                                    str +=
                                        "<div class=\"btnbox\"><a href=\"javascript:;\" class=\"btn new-info\" data-bgw=\"" +
                                        tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                        "\">新增热点</a> <a href=\"javascript:;\" class=\"btn edit-bpic\" data-bgw=\"" +
                                        tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                        "\" data-tiid=\"" +
                                        timodel.TIID + "\">编辑背景</a></div>";
                                }
                                else
                                {
                                    str +=
                                        "<div class=\"btnbox\"><a href=\"javascript:;\" data-bgw=\"" +
                                        tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                        "\" class=\"btn edit-bpic\" data-tiid=\"" +
                                        timodel.TIID + "\">编辑背景</a></div>";
                                }
                            }
                            else
                            {
                                str +=
                                    "<div class=\"btnbox\"><a href=\"javascript:;\" class=\"btn new-info\" data-bgw=\"" +
                                    tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                    "\">新增热点</a> <a href=\"javascript:;\" class=\"btn edit-bpic\" data-bgw=\"" +
                                    tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                    "\" data-tiid=\"" + timodel.TIID + "\">上传背景</a>";
                                //str += " <a href=\"javascript:;\" class=\"btn select-info\" data-sortnum=\"1\">选择</a>";
                                str += "</div>";
                            }
                            if (!string.IsNullOrEmpty(timodel.AttID))
                            {
                                str += "<img src=\"/UploadFiles/" + timodel.AttID + "\">";
                            }
                            else
                            {
                                str += "<img>";
                            }
                            str          += "</div>";
                            litInfo1.Text = str;
                        }
                    }

                    #endregion
                }
            }
        }
示例#15
0
        async Task IMiscDataNM.MiscDataReceived(string status, string content)
        {
            switch (status)
            {
            case "laiddowninitial":
                await CreateSetsAsync(content);
                await InitialCompletedAsync();

                return;

            case "createnewset":
                var thisItem = await js.DeserializeObjectAsync <SendCreateSet>(content);

                var thisCol  = thisItem.CardList.GetObjectsFromList(SingleInfo !.MainHandList);
                var thisTemp = new TempInfo();
                thisTemp.CardList = thisCol;
                thisTemp.WhatSet  = thisItem.WhatSet;
                await CreateNewSetAsync(thisTemp, false);

                return;

            case "undomove":
                await UndoMoveAsync();

                return;

            case "finished":
                await FinishedAsync(bool.Parse(content));     //hopefully okay.

                return;

            case "drewtile":
                var thisSend1 = await js.DeserializeObjectAsync <SendDraw>(content);

                var thisTile = _model !.Pool1 !.GetTile(thisSend1.Deck);
                await DrawTileAsync(thisTile, thisSend1.FromEnd);

                return;

            case "removeentireset":
                await RemoveEntireSetAsync(int.Parse(content));

                return;

            case "removeonefromset":
                var thisSend2 = await js.DeserializeObjectAsync <SendSet>(content);
                await RemoveTileFromSetAsync(thisSend2.Index, thisSend2.Tile);

                return;

            case "addtoset":
                var thisSend3 = await js.DeserializeObjectAsync <SendSet>(content);

                var thisTile2 = _model !.Pool1 !.GetTile(thisSend3.Tile);
                thisTile2.IsUnknown = false;
                SingleInfo !.MainHandList.RemoveObjectByDeck(thisSend3.Tile);
                await AddToSetAsync(thisSend3.Index, thisTile2, thisSend3.Position);

                return;

            case "endcustom":
                var thisEnd = await js.DeserializeObjectAsync <SendCustom>(content);
                await EndTurnAsync(thisEnd.DidPlay, thisEnd.ValidSets);

                return;

            default:
                throw new BasicBlankException($"Nothing for status {status}  with the message of {content}");
            }
        }
示例#16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            VerifyPage("", true);
            if (!IsPostBack)
            {
                var spid = Request.QueryString["spid"];

                if (!string.IsNullOrEmpty(spid))
                {
                    #region 左侧分类

                    var itid = Request.QueryString["itid"]; //分类id
                    if (!string.IsNullOrEmpty(itid))
                    {
                        var model = _infoTypeDal.GetModel(Convert.ToInt32(itid));
                        if (null != model)
                        {
                            litType.Text = Service.GetType(Convert.ToInt32(model.ITID), spid);
                        }
                    }
                    else
                    {
                        litType.Text = Service.GetType(0, spid);
                    }

                    #endregion

                    #region 块内容

                    var tiid = Request.QueryString["tiid"];
                    if (!string.IsNullOrEmpty(tiid))
                    {
                        TempInfo _tempInfoDal = new TempInfo();
                        var      timodel      = _tempInfoDal.GetModel(Convert.ToInt32(tiid));
                        if (null != timodel)
                        {
                            #region 导航
                            litStaName.Text = Service.Nav(timodel, Request.QueryString["spid"], Request.QueryString["itid"]);
                            #endregion

                            #region 分页

                            var pager = "";
                            List <SqlParameter> parDef = new List <SqlParameter>();
                            var preitModel             =
                                _tempInfoDal.GetModel(
                                    " ITID=" + timodel.ITID + " and ParentID=" + timodel.ParentID + " and TIPage=" +
                                    (timodel.TIPage - 1), parDef);
                            if (null != preitModel)
                            {
                                pager += "<td><a href=\"/Manage/Template/Redircet.aspx?itid=" +
                                         Request.QueryString["itid"] + "&spid=" + Request.QueryString["spid"] + "&tiid=" +
                                         preitModel.TIID + "\" class=\"btn btnprev\" data-tiid=\"" + preitModel.TIID +
                                         "\">上页 </a></td>";
                            }
                            else
                            {
                                pager += "<td>&nbsp;</td>";
                            }
                            var count =
                                _tempInfoDal.GetList(" TIPage is not null and TIPage!='' and ITID=" + timodel.ITID + " and ParentID=" + timodel.ParentID,
                                                     parDef).Tables[0].Rows.Count;
                            if (count > 1)
                            {
                                pager +=
                                    "<td>页码 </td><td><input type=\"text\" class=\"form-control input-sm iptpno\" value=\"" +
                                    timodel.TIPage +
                                    "\" style=\"width: 40px;display:inline;text-align: center;\" /> /" + count + "</td><td><input data-parcount=\"" + timodel.ParentID + "\" data-count=\"" + count + "\" type=\"button\" class=\"btn btn-sm repage\" value=\"跳转\" style=\"width: 70px;\" /></td><td><input type=\"button\" class=\"btn btn-sm editpno\" value=\"修改页码\" style=\"width: 70px;\" /></td><td><input type=\"button\" class=\"btn btn-sm delpage\" value=\"删除当前页\"/></td>";
                            }
                            else if (count == 1)
                            {
                                pager +=
                                    "<td><input type=\"button\" class=\"btn btn-sm delpage\" value=\"删除当前页\"/></td>";
                            }
                            var nexitModel =
                                _tempInfoDal.GetModel(
                                    " ITID=" + timodel.ITID + " and ParentID=" + timodel.ParentID + " and TIPage=" +
                                    (timodel.TIPage + 1), parDef);
                            if (null != nexitModel)
                            {
                                pager += "<td><a href=\"/Manage/Template/Redircet.aspx?itid=" +
                                         Request.QueryString["itid"] + "&spid=" + Request.QueryString["spid"] + "&tiid=" +
                                         nexitModel.TIID + "\" class=\"btn btnnext\" data-tiid=\"" +
                                         nexitModel.TIID + "\">下页 </a></td>";
                            }
                            else
                            {
                                pager          += "<td>&nbsp;</td>";
                                litNewPage.Text = "<a href=\"/Manage/Systems/ChooseNewsTemplate.aspx?page=" +
                                                  (timodel.TIPage + 1) + "&pid=" + timodel.ParentID + "&itid=" +
                                                  Request.QueryString["itid"] + "&spid=" + Request.QueryString["spid"] +
                                                  "&tiid=" + timodel.TIID + "\" class=\"btn btn-add newpage\" style=\"top:33%\">新建内容页</a> <a href=\"/Manage/News/RedircetAD.aspx?itid=" +
                                                  Request.QueryString["itid"] + "&spid=" + Request.QueryString["spid"] + "&tiid=" +
                                                  timodel.TIID + "\" class=\"btn btn-add newpage\" style=\"top:53%\">添加文末广告</a>";
                            }
                            litPager.Text = pager;

                            #endregion

                            #region

                            var sortNum = 1;
                            List <SqlParameter> par1 = new List <SqlParameter>();
                            var tmpPar1 =
                                _templateParDal.GetModel(" TID=" + timodel.TID + " and SortNum=" + sortNum + " ", par1);

                            var info1 = _infosDal.GetModel(" TIID=" + timodel.TIID + " and SortNum=" + sortNum + " ",
                                                           par1);
                            if (null != info1)
                            {
                                #region 图文资讯反显
                                var user = (OrgUsers)HttpContext.Current.Session["CurrentUser"];
                                if (info1.IType == 4)
                                {
                                    litInfo1.Text =
                                        "<div class=\"btnbox\" style=\"top:54%;display:none\"><a href=\"javascript:;\" class=\"btn edit-info\" data-iid=\"" +
                                        info1.IID + "\" data-sortnum=\"" + sortNum +
                                        "\" data-bgw=\"" + tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                        "\">编辑</a> <a href=\"javascript:;\" class=\"btn del-info\" data-iid=\"" +
                                        info1.IID +
                                        "\" data-sortnum=\"" + sortNum +
                                        "\" data-bgw=\"" + tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                        "\">删除</a>";

                                    if (1 == user.Type)
                                    {
                                        if (1 == info1.Status)
                                        {
                                            litInfo1.Text += " <a href=\"javascript:;\" class=\"btn sin-info btn-warning\" data-iid=\"" +
                                                             info1.IID +
                                                             "\">标记</a>";
                                        }
                                        else
                                        {
                                            litInfo1.Text += " <a href=\"javascript:;\" class=\"btn sin-info btn-warning\" data-iid=\"" +
                                                             info1.IID +
                                                             "\">取消标记</a>";
                                        }
                                    }
                                    else
                                    {
                                        if (0 == info1.Status)
                                        {
                                            litInfo1.Text += " <span class=\"btn btn-editing\">待修改</span>";
                                        }
                                    }
                                    litInfo1.Text += "</div>";

                                    litInfo1.Text += "<div class=\"txtbox tbox" + info1.ConPosition + "\"><div class=\"pd\" style=\"font-size:" + info1.ConSize + "px;color:#" + info1.ConColor + "; word-break: break-all;\">" + info1.Context + "</div></div><img src=\"/UploadFiles/" + info1.PicAttID + "\" style=\"height:606px; display:block; width:100%;\">";
                                    List <SqlParameter> par = new List <SqlParameter>();
                                    par.Add(new SqlParameter("@IID", DbType.AnsiString)
                                    {
                                        Value = info1.IID
                                    });
                                    var dt = _adInfosDal.GetListAI(" AdInfos.IID=@IID ", par).Tables[0];
                                }

                                #endregion
                            }
                            else
                            {
                                litInfo1.Text =
                                    "<div class=\"btnbox\"><a href=\"javascript:;\" class=\"btn new-info\" data-sortnum=\"" +
                                    sortNum +
                                    "\" data-bgw=\"" + tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                    "\">编辑</a>";
                                //litInfo1.Text += " <a href=\"javascript:;\" class=\"btn select-info\" data-sortnum=\"" +
                                //    sortNum +
                                //    "\">选择</a>";
                                litInfo1.Text += "</div><img>";
                            }

                            #endregion
                        }
                    }

                    #endregion
                }
            }
        }
        /// <summary>
        /// 编辑模板
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public ActionResult Edit(string name)
        {
            TempInfo ti = new TempInfo(name);

            return(View(ti));
        }
示例#18
0
 public void SetParent(TempInfo _parent)
 {
     parent = _parent;
     value  = new ModifiableInt(AttributeModified);
 }
示例#19
0
        private async void OKbutton_Click(object sender, EventArgs e)
        {
            table.Rows.Clear();
            float  min = 0, max = 100;
            string filter  = "Humidity";
            int    limit   = 100;
            bool   isLimit = true;

            x.Clear();
            yTemp.Clear();
            yHum.Clear();
            chart1.Series[0].Points.DataBindXY(x, yTemp);
            chart1.Series[1].Points.DataBindXY(x, yHum);

            if (limitsCB.SelectedItem.ToString() != "no limit")
            {
                limit   = int.Parse(limitsCB.SelectedItem.ToString());
                isLimit = true;
            }
            else
            {
                isLimit = false;
            }

            if (humRB.Checked)
            {
                filter = "Humidity";
            }
            if (tempRB.Checked)
            {
                filter = "Temperature";
            }
            if (minTxb.Text != "")
            {
                min = float.Parse(minTxb.Text);
            }
            if (maxTxb.Text != "")
            {
                max = float.Parse(maxTxb.Text);
            }

            /*if (RBallAlarm.Checked)
             * {
             *
             * }
             * if (RBalarmOn.Checked)
             * {
             *  filter = "alarm on";
             * }
             * if (RBalarmOff.Checked)
             * {
             *  filter = "alarm off";
             * }*/



            if (timeRD.Checked)
            {
                if (isLimit)
                {
                    long          minUnixTime          = ((DateTimeOffset)minDatePicker.Value).ToUnixTimeSeconds() - 86400;
                    long          maxUnixTime          = ((DateTimeOffset)maxDatePicker.Value).ToUnixTimeSeconds();
                    Query         capitalQuery         = Program.db.Collection(MainFRM.COLLECTION_NAME).WhereGreaterThanOrEqualTo("WhenUNIX", minUnixTime).WhereLessThanOrEqualTo("WhenUNIX", maxUnixTime).Limit(limit);
                    QuerySnapshot capitalQuerySnapshot = await capitalQuery.GetSnapshotAsync();

                    foreach (DocumentSnapshot documentSnapshot in capitalQuerySnapshot.Documents)
                    {
                        TempInfo temp = documentSnapshot.ConvertTo <TempInfo>();

                        if (RBalarmOn.Checked)
                        {
                            if (temp.IsAlarmed)
                            {
                                table.Rows.Add(temp.WhenString, temp.Temperature, temp.Humidity, temp.IsAlarmed);
                            }
                        }
                        else if (RBalarmOff.Checked)
                        {
                            if (!temp.IsAlarmed)
                            {
                                table.Rows.Add(temp.WhenString, temp.Temperature, temp.Humidity, temp.IsAlarmed);
                            }
                        }
                        else
                        {
                            table.Rows.Add(temp.WhenString, temp.Temperature, temp.Humidity, temp.IsAlarmed);
                        }
                    }
                    DataView dv = table.DefaultView;
                    dv.Sort   = "Time";
                    SortTable = dv.ToTable();
                    x         = SortTable.Rows.OfType <DataRow>().Select(dr => dr.Field <string>("Time")).ToList();
                    yTemp     = SortTable.Rows.OfType <DataRow>().Select(dr => dr.Field <float>("Temp")).ToList();
                    yHum      = SortTable.Rows.OfType <DataRow>().Select(dr => dr.Field <float>("Hum")).ToList();
                    chart1.Series[0].Points.DataBindXY(x, yTemp);
                    chart1.Series[1].Points.DataBindXY(x, yHum);
                }
                else
                {
                    long          minUnixTime          = ((DateTimeOffset)minDatePicker.Value).ToUnixTimeSeconds() - 86400;
                    long          maxUnixTime          = ((DateTimeOffset)maxDatePicker.Value).ToUnixTimeSeconds();
                    Query         capitalQuery         = Program.db.Collection(MainFRM.COLLECTION_NAME).WhereGreaterThanOrEqualTo("WhenUNIX", minUnixTime).WhereLessThanOrEqualTo("WhenUNIX", maxUnixTime);
                    QuerySnapshot capitalQuerySnapshot = await capitalQuery.GetSnapshotAsync();

                    foreach (DocumentSnapshot documentSnapshot in capitalQuerySnapshot.Documents)
                    {
                        TempInfo temp = documentSnapshot.ConvertTo <TempInfo>();

                        table.Rows.Add(temp.WhenString, temp.Temperature, temp.Humidity, temp.IsAlarmed);
                    }
                    DataView dv = table.DefaultView;
                    dv.Sort   = "Time";
                    SortTable = dv.ToTable();
                    x         = SortTable.Rows.OfType <DataRow>().Select(dr => dr.Field <string>("Time")).ToList();
                    yTemp     = SortTable.Rows.OfType <DataRow>().Select(dr => dr.Field <float>("Temp")).ToList();
                    yHum      = SortTable.Rows.OfType <DataRow>().Select(dr => dr.Field <float>("Hum")).ToList();
                    chart1.Series[0].Points.DataBindXY(x, yTemp);
                    chart1.Series[1].Points.DataBindXY(x, yHum);
                }
            }
            else
            {
                if (isLimit)
                {
                    Query         capitalQuery         = Program.db.Collection(MainFRM.COLLECTION_NAME).WhereGreaterThanOrEqualTo(filter, min).WhereLessThanOrEqualTo(filter, max).Limit(limit);
                    QuerySnapshot capitalQuerySnapshot = await capitalQuery.GetSnapshotAsync();

                    foreach (DocumentSnapshot documentSnapshot in capitalQuerySnapshot.Documents)
                    {
                        TempInfo temp = documentSnapshot.ConvertTo <TempInfo>();

                        if (RBalarmOn.Checked)
                        {
                            if (temp.IsAlarmed)
                            {
                                table.Rows.Add(temp.WhenString, temp.Temperature, temp.Humidity, temp.IsAlarmed);
                            }
                        }
                        else if (RBalarmOff.Checked)
                        {
                            if (!temp.IsAlarmed)
                            {
                                table.Rows.Add(temp.WhenString, temp.Temperature, temp.Humidity, temp.IsAlarmed);
                            }
                        }
                        else
                        {
                            table.Rows.Add(temp.WhenString, temp.Temperature, temp.Humidity, temp.IsAlarmed);
                        }
                    }
                    DataView dv = table.DefaultView;
                    dv.Sort   = "Time";
                    SortTable = dv.ToTable();
                    x         = SortTable.Rows.OfType <DataRow>().Select(dr => dr.Field <string>("Time")).ToList();
                    yTemp     = SortTable.Rows.OfType <DataRow>().Select(dr => dr.Field <float>("Temp")).ToList();
                    yHum      = SortTable.Rows.OfType <DataRow>().Select(dr => dr.Field <float>("Hum")).ToList();
                    chart1.Series[0].Points.DataBindXY(x, yTemp);
                    chart1.Series[1].Points.DataBindXY(x, yHum);
                }
                else
                {
                    Query         capitalQuery         = Program.db.Collection(MainFRM.COLLECTION_NAME).WhereGreaterThanOrEqualTo(filter, min).WhereLessThanOrEqualTo(filter, max);
                    QuerySnapshot capitalQuerySnapshot = await capitalQuery.GetSnapshotAsync();

                    foreach (DocumentSnapshot documentSnapshot in capitalQuerySnapshot.Documents)
                    {
                        TempInfo temp = documentSnapshot.ConvertTo <TempInfo>();

                        if (RBalarmOn.Checked)
                        {
                            if (temp.IsAlarmed)
                            {
                                table.Rows.Add(temp.WhenString, temp.Temperature, temp.Humidity, temp.IsAlarmed);
                            }
                        }
                        else if (RBalarmOff.Checked)
                        {
                            if (!temp.IsAlarmed)
                            {
                                table.Rows.Add(temp.WhenString, temp.Temperature, temp.Humidity, temp.IsAlarmed);
                            }
                        }
                        else
                        {
                            table.Rows.Add(temp.WhenString, temp.Temperature, temp.Humidity, temp.IsAlarmed);
                        }
                    }
                    DataView dv = table.DefaultView;
                    dv.Sort   = "Time";
                    SortTable = dv.ToTable();
                    x         = SortTable.Rows.OfType <DataRow>().Select(dr => dr.Field <string>("Time")).ToList();
                    yTemp     = SortTable.Rows.OfType <DataRow>().Select(dr => dr.Field <float>("Temp")).ToList();
                    yHum      = SortTable.Rows.OfType <DataRow>().Select(dr => dr.Field <float>("Hum")).ToList();
                    chart1.Series[0].Points.DataBindXY(x, yTemp);
                    chart1.Series[1].Points.DataBindXY(x, yHum);
                }
            }
        }