Exemple #1
0
        protected override void ShowBrokenRule()
        {
            try
            {
                BreakRuleIndex += 1;
                BrokenRuleInfo RuleInfo = brokenRuleMessage.RuleInfo;
                mainLinerLayout = (LinearLayout)this.FindViewById(Resource.Id.RuleBreakTable);
                LinearLayout  linearLayout = (LinearLayout)LayoutInflater.From(this).Inflate(Resource.Layout.tableBeiKe, null);
                TableTextView txt          = (TableTextView)linearLayout.FindViewById(Resource.Id.list_1_1);
                txt.SetText(BreakRuleIndex.ToString(), TextView.BufferType.Normal);
                txt.SetTextColor(Color.Red);

                txt = (TableTextView)linearLayout.FindViewById(Resource.Id.list_1_2);
                txt.SetText(RuleInfo.RuleName.ToString(), TextView.BufferType.Normal);
                txt.SetTextColor(Color.Red);

                txt = (TableTextView)linearLayout.FindViewById(Resource.Id.list_1_3);
                txt.SetText(RuleInfo.DeductedScores.ToString(), TextView.BufferType.Normal);
                txt.SetTextColor(Color.Red);

                txt = (TableTextView)linearLayout.FindViewById(Resource.Id.list_1_4);
                txt.SetText(RuleInfo.BreakTime.ToString("HH:mm:ss"), TextView.BufferType.Normal);
                txt.SetTextColor(Color.Red);

                txt = (TableTextView)linearLayout.FindViewById(Resource.Id.list_1_5);
                txt.SetText(RuleInfo.RuleCode, TextView.BufferType.Normal);
                txt.SetTextColor(Color.Red);

                mainLinerLayout.AddView(linearLayout);
            }
            catch (Exception ex)
            {
                Logger.Error("ShowBorkenRule", ex.Message);
            }
        }
        private void ShowBrokenRule()
        {
            try
            {
                InitBrokenRules();
                lstBorkenRuleInfo.Add(brokenRuleMessage.RuleInfo);

                for (int i = lstBorkenRuleInfo.Count - 1; i >= 0; i--)
                {
                    mainLinerLayout = (LinearLayout)this.FindViewById(Resource.Id.RuleBreakTable);
                    relativeLayout  = (RelativeLayout)LayoutInflater.From(this).Inflate(Resource.Layout.tableHuaZhong, null);
                    TableTextView txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_1);
                    txt.SetText(lstBorkenRuleInfo[i].ExamItemName, TextView.BufferType.Normal);
                    txt.SetTextColor(Color.Red);

                    txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_2);
                    txt.SetText(lstBorkenRuleInfo[i].DeductedScores.ToString(), TextView.BufferType.Normal);
                    txt.SetTextColor(Color.Red);

                    txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_3);
                    txt.SetText(lstBorkenRuleInfo[i].RuleName, TextView.BufferType.Normal);
                    txt.SetTextColor(Color.Red);
                    mainLinerLayout.AddView(relativeLayout);
                }
            }
            catch (Exception ex)
            {
                Logger.Error("ShowBorkenRule", ex.Message);
            }
        }
Exemple #3
0
        private void ShowBrokenRule()
        {
            try
            {
                BrokenRuleInfo RuleInfo = brokenRuleMessage.RuleInfo;
                mainLinerLayout = (LinearLayout)this.FindViewById(Resource.Id.RuleBreakTable);
                relativeLayout  = (RelativeLayout)LayoutInflater.From(this).Inflate(Resource.Layout.tableMobilePhone, null);
                TableTextView txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_1);
                txt.SetText(RuleInfo.ExamItemName, TextView.BufferType.Normal);
                txt.SetTextColor(Color.Red);

                txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_2);
                txt.SetText(RuleInfo.DeductedScores.ToString(), TextView.BufferType.Normal);
                txt.SetTextColor(Color.Red);

                txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_3);
                txt.SetText(RuleInfo.RuleName, TextView.BufferType.Normal);
                txt.SetTextColor(Color.Red);
                mainLinerLayout.AddView(relativeLayout);
            }
            catch (Exception ex)
            {
                Logger.Error("ShowBorkenRule", ex.Message);
            }
        }
Exemple #4
0
        protected override void InitBrokenRules()
        {
            mainLinerLayout = (LinearLayout)this.FindViewById(Resource.Id.RuleBreakTable);
            LinearLayout linearLayout = (LinearLayout)LayoutInflater.From(this).Inflate(Resource.Layout.tableBeiKe, null);

            TableTextView txt = (TableTextView)linearLayout.FindViewById(Resource.Id.list_1_1);

            txt.SetText("序号", TextView.BufferType.Normal);
            txt.SetTextColor(Color.Black);
            txt.SetBackgroundColor(Color.White);

            txt = (TableTextView)linearLayout.FindViewById(Resource.Id.list_1_2);
            txt.SetText("错误信息", TextView.BufferType.Normal);
            txt.SetTextColor(Color.Black);
            txt.SetBackgroundColor(Color.White);

            txt = (TableTextView)linearLayout.FindViewById(Resource.Id.list_1_3);
            txt.SetText("扣分", TextView.BufferType.Normal);
            txt.SetTextColor(Color.Black);
            txt.SetBackgroundColor(Color.White);

            txt = (TableTextView)linearLayout.FindViewById(Resource.Id.list_1_4);
            txt.SetText("时间", TextView.BufferType.Normal);
            txt.SetTextColor(Color.Black);
            txt.SetBackgroundColor(Color.White);

            txt = (TableTextView)linearLayout.FindViewById(Resource.Id.list_1_5);
            txt.SetText("代码", TextView.BufferType.Normal);
            txt.SetTextColor(Color.Black);
            txt.SetBackgroundColor(Color.White);

            mainLinerLayout.AddView(linearLayout);
        }
Exemple #5
0
        private void InitBrokenRules()
        {
            mainLinerLayout = (LinearLayout)this.FindViewById(Resource.Id.RuleBreakTable);
            relativeLayout  = (RelativeLayout)LayoutInflater.From(this).Inflate(Resource.Layout.tableJingTang, null);

            TableTextView txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_1);

            txt.SetText("序号", TextView.BufferType.Normal);
            txt.SetTextColor(Color.Black);
            txt.SetBackgroundColor(Color.White);

            txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_2);
            txt.SetText("错误信息", TextView.BufferType.Normal);
            txt.SetTextColor(Color.Black);
            txt.SetBackgroundColor(Color.White);

            txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_3);
            txt.SetText("扣分", TextView.BufferType.Normal);
            txt.SetTextColor(Color.Black);
            txt.SetBackgroundColor(Color.White);

            txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_4);
            txt.SetText("错误时间", TextView.BufferType.Normal);
            txt.SetTextColor(Color.Black);
            txt.SetBackgroundColor(Color.White);

            txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_5);
            txt.SetText("错误代码", TextView.BufferType.Normal);
            txt.SetTextColor(Color.Black);
            txt.SetBackgroundColor(Color.White);

            mainLinerLayout.AddView(relativeLayout);
        }
Exemple #6
0
        //这样是可以的但是没有办法定位到索引
        private void Txt_LongClick(object sender, View.LongClickEventArgs e)
        {
            try
            {
                TableTextView tv = (TableTextView)sender;
                int           id = Convert.ToInt32(tv.Tag.ToString().Trim());
                // Toast.MakeText(this, id.ToString(), ToastLength.Long);

                var examContentRuleItem = ExamContext.Rules.Where(s => s.Id == id).FirstOrDefault();
                ExamContext.Rules.Remove(examContentRuleItem);
                //把分数加回去
                ExamContext.Score.AddScore(examContentRuleItem.DeductedScores);
                //更新分数
                tvScore.Text = string.Format("{0}", ExamContext.ExamScore);

                //扣分之后需要把分加回去

                var removeItem = lstRules.Where(s => s.Id == id).FirstOrDefault();
                lstRules.Remove(removeItem);

                mainLinerLayout = (LinearLayout)this.FindViewById(Resource.Id.RuleBreakTable);
                mainLinerLayout.RemoveAllViews();
                //不可以只移除界面显示需要移除内存里面的东西
                for (int i = lstRules.Count; i > 0; i--)
                {
                    var item = lstRules[i - 1];
                    relativeLayout = (LinearLayout)LayoutInflater.From(this).Inflate(Resource.Layout.tableNew, null);
                    TableTextView txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_1);
                    txt.SetText(item.ExamItemName, TextView.BufferType.Normal);
                    txt.SetTextColor(Color.Red);

                    txt.Tag        = item.Id.ToString();
                    txt.LongClick += Txt_LongClick;


                    txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_2);
                    txt.SetText(item.DeductedScores.ToString(), TextView.BufferType.Normal);
                    txt.SetTextColor(Color.Red);

                    txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_3);
                    txt.SetText(item.RuleName, TextView.BufferType.Normal);
                    txt.SetTextColor(Color.Red);

                    mainLinerLayout.AddView(relativeLayout);
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex, GetType().ToString());
            }
        }
Exemple #7
0
        private void InitBrokenRules()
        {
            mainLinerLayout = (LinearLayout)this.FindViewById(Resource.Id.RuleBreakTable);
            relativeLayout  = (RelativeLayout)LayoutInflater.From(this).Inflate(Resource.Layout.table, null);
            mainLinerLayout.RemoveAllViews();
            TableTextView title = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_1);

            title.SetText("扣分项目", TextView.BufferType.Normal);
            title.SetTextColor(Color.Black);

            title = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_2);
            title.SetText("扣分", TextView.BufferType.Normal);
            title.SetTextColor(Color.Black);

            title = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_3);
            title.SetText("原因", TextView.BufferType.Normal);
            title.SetTextColor(Color.Black);
            mainLinerLayout.AddView(relativeLayout);
        }
Exemple #8
0
        //Remove之后进行刷新重新显示
        private void ShowBrokenRule()
        {
            try
            {
                //我需要获取一个索引
                mainLinerLayout = (LinearLayout)this.FindViewById(Resource.Id.RuleBreakTable);
                mainLinerLayout.RemoveAllViews();
                BrokenRuleInfo RuleInfo = brokenRuleMessage.RuleInfo;
                lstRules.Add(RuleInfo);
                //lstRules.Reverse();
                //todo:为什么要-1 ?
                for (int i = lstRules.Count; i > 0; i--)
                {
                    //数组索引从0开始
                    var item = lstRules[i - 1];
                    relativeLayout = (LinearLayout)LayoutInflater.From(this).Inflate(Resource.Layout.tableNew, null);
                    TableTextView txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_1);
                    txt.SetText(item.ExamItemName, TextView.BufferType.Normal);
                    txt.SetTextColor(Color.Red);
                    txt.Tag        = item.Id.ToString();
                    txt.LongClick += Txt_LongClick;

                    //txt.SetOnClickListener = (new View:O);

                    txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_2);
                    txt.SetText(item.DeductedScores.ToString(), TextView.BufferType.Normal);
                    txt.SetTextColor(Color.Red);

                    txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_3);
                    txt.SetText(item.RuleName, TextView.BufferType.Normal);
                    txt.SetTextColor(Color.Red);

                    mainLinerLayout.AddView(relativeLayout);
                }
            }
            catch (Exception ex)
            {
                Logger.Error("ShowBorkenRule", ex.Message);
            }
        }
Exemple #9
0
        private void Txt_LongClick(object sender, View.LongClickEventArgs e)
        {
            try
            {
                TableTextView tv = (TableTextView)sender;
                // LogManager.WriteSystemLog("tvtext" + tv.Tag.ToString());
                int id         = Convert.ToInt32(tv.Tag.ToString().Trim());
                var removeItem = lstBorkenRuleInfo.Where(s => s.Id == id).FirstOrDefault();
                lstBorkenRuleInfo.Remove(removeItem);
                InitBrokenRules();
                //mainLinerLayout = (LinearLayout)this.FindViewById(Resource.Id.RuleBreakTable);
                //mainLinerLayout.RemoveAllViews();
                for (int i = lstBorkenRuleInfo.Count - 1; i > 0; i--)
                {
                    var item = lstBorkenRuleInfo[i];
                    relativeLayout = (RelativeLayout)LayoutInflater.From(this).Inflate(Resource.Layout.tableHuaZhong, null);
                    TableTextView txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_1);
                    txt.SetText(item.ExamItemName, TextView.BufferType.Normal);
                    txt.SetTextColor(Color.Red);

                    txt.Tag        = item.Id.ToString();
                    txt.LongClick += Txt_LongClick;

                    txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_2);
                    txt.SetText(item.DeductedScores.ToString(), TextView.BufferType.Normal);
                    txt.SetTextColor(Color.Red);

                    txt = (TableTextView)relativeLayout.FindViewById(Resource.Id.list_1_3);
                    txt.SetText(item.RuleName, TextView.BufferType.Normal);
                    txt.SetTextColor(Color.Red);

                    mainLinerLayout.AddView(relativeLayout);
                }
            }
            catch (Exception ex)
            {
                LogManager.WriteSystemLog(ex.Message + ex.Source + ex.StackTrace);
            }
        }