Ejemplo n.º 1
0
        /// <summary>
        /// 复制检查单库
        /// </summary>
        void CopyCheckLib(HttpContext context)
        {
            bool result = false;
            long id     = 0;

            if (!string.IsNullOrEmpty(context.Request.QueryString["id"]) && long.TryParse(context.Request.QueryString["id"], out id))
            {
                result = new CheckListBLL().CopyLib(id, LoginUserId);
            }
            WriteResponseJson(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 删除检查单库
        /// </summary>
        void DeleteCheckLib(HttpContext context)
        {
            bool   result = false;
            string reason = string.Empty;
            long   id     = 0;

            if (!string.IsNullOrEmpty(context.Request.QueryString["id"]) && long.TryParse(context.Request.QueryString["id"], out id))
            {
                result = new CheckListBLL().DeleteBoard(id, LoginUserId, ref reason);
            }
            WriteResponseJson(new { result = result, reason = reason });
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 获取检查单库
        /// </summary>
        void CheckLibInfo(HttpContext context)
        {
            long id = 0;

            if (!string.IsNullOrEmpty(context.Request.QueryString["id"]) && long.TryParse(context.Request.QueryString["id"], out id))
            {
                sys_checklist_lib lib = new CheckListBLL().GetLib(id);
                if (lib != null)
                {
                    WriteResponseJson(lib);
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 激活/失活 检查单库
        /// </summary>
        void ActiveCheckLib(HttpContext context)
        {
            bool result   = false;
            bool isAvtive = false;

            if (!string.IsNullOrEmpty(context.Request.QueryString["isActive"]) && context.Request.QueryString["isActive"] == "1")
            {
                isAvtive = true;
            }
            long id = 0;

            if (!string.IsNullOrEmpty(context.Request.QueryString["id"]) && long.TryParse(context.Request.QueryString["id"], out id))
            {
                result = new CheckListBLL().ActivLib(id, LoginUserId, isAvtive);
            }
            WriteResponseJson(result);
        }
Ejemplo n.º 5
0
        private void btnProximo_Click(object sender, EventArgs e)
        {
            CheckListBLL BLL = new CheckListBLL();

            if (BLL.Cadastra_Finaliza(txtKmFinal.Text, txtObs.Text))
            {
                MessageBox.Show("CHECKLIST FINALIZADO!!! TKS BOM DESCANSO!!");
            }
            else
            {
                MessageBox.Show("Digite o KM CORRETAMENTE PARA FINALIZAR");
            }

            MensagemErro();

            Application.Restart();
        }
Ejemplo n.º 6
0
        private void btnFinalizar_Click(object sender, EventArgs e)
        {
            VerificaCheck();
            check.Chaves = chavesSelect;

            CheckListBLL BLL = new CheckListBLL();

            if (BLL.Cadastra(check))
            {
                MessageBox.Show("SUCESSO EM GRAVAR CHECKLIST!! BOM PLANTÃO!!");
            }
            else
            {
                MessageBox.Show("HOUVE ERROS DURANTE O PROCESSO, REINICIE A OPERAÇÃO!!");
            }


            MensagemErro();
            Application.Restart();
        }
Ejemplo n.º 7
0
        private bool Cadastrar()
        {
            int  total  = switches.Count;
            int  cont   = 0;
            bool ticado = false;

            foreach (var c in chavesA)
            {
                if (switches.Count < total)
                {
                    try { ticado = switches[cont].Checked; } catch { }
                }
                if (ticado)
                {
                    c.Check = 1;
                }
                else
                {
                    c.Check = 0;
                }
                check.Chaves.Add(c);
                cont++;
            }

            CheckListBLL BLL2 = new CheckListBLL();

            if (BLL2.Cadastra(check))
            {
                return(true);
                //Toast.MakeText(this, "CHECKLIST CADASTRADO", ToastLength.Long).Show();
                //this.FinishAffinity();
            }
            else
            {
                return(false);
            }
            //Toast.MakeText(this, "FALHA EM CADASTRAT CHECKLIST, REFAÇA!!!", ToastLength.Long).Show();
        }
Ejemplo n.º 8
0
        public CheckList_Chaves(Check check)
        {
            InitializeComponent();


            this.check = check;

            int area = 0;  //seta a area do alfa que verá as chaves

            try { area = Convert.ToInt32(check.Area); } catch { area = 1; }

            CheckListBLL BLL = new CheckListBLL();

            chaves = BLL.ListaChaves();

            //int count = 0;

            if (chaves != null)
            {
                //chavesA = chaves;  // depois apagar

                foreach (Chave p in chaves)
                {
                    int a1 = 1;
                    try { a1 = Convert.ToInt32(p.Area); } catch { }
                    if (area == a1)
                    {
                        chavesA.Add(p);
                    }
                }

                //separação por área apos criar opção no banco


                if (chavesA != null)
                {
                    checkBox1.Visible = true;
                    checkBox1.Text    = chavesA[0].Nome;

                    if (chavesA.Count > 1)
                    {
                        checkBox2.Visible = true;
                        checkBox2.Text    = chavesA[1].Nome;
                    }
                    if (chavesA.Count > 2)
                    {
                        checkBox3.Visible = true;
                        checkBox3.Text    = chavesA[2].Nome;
                    }
                    if (chavesA.Count > 3)
                    {
                        checkBox4.Visible = true;
                        checkBox4.Text    = chavesA[3].Nome;
                    }
                    if (chavesA.Count > 4)
                    {
                        checkBox5.Visible = true;
                        checkBox5.Text    = chavesA[4].Nome;
                    }
                    if (chavesA.Count > 5)
                    {
                        checkBox6.Visible = true;
                        checkBox6.Text    = chavesA[5].Nome;
                    }
                    if (chavesA.Count > 6)
                    {
                        checkBox7.Visible = true;
                        checkBox7.Text    = chavesA[6].Nome;
                    }
                    if (chavesA.Count > 7)
                    {
                        checkBox8.Visible = true;
                        checkBox8.Text    = chavesA[7].Nome;
                    }
                    if (chavesA.Count > 8)
                    {
                        checkBox9.Visible = true;
                        checkBox9.Text    = chavesA[8].Nome;
                    }
                    if (chavesA.Count > 9)
                    {
                        checkBox10.Visible = true;
                        checkBox10.Text    = chavesA[9].Nome;
                    }
                    if (chavesA.Count > 10)
                    {
                        checkBox11.Visible = true;
                        checkBox11.Text    = chavesA[10].Nome;
                    }

                    if (chavesA.Count > 11)
                    {
                        checkBox12.Visible = true;
                        checkBox12.Text    = chavesA[11].Nome;
                    }

                    if (chavesA.Count > 12)
                    {
                        checkBox13.Visible = true;
                        checkBox13.Text    = chavesA[12].Nome;
                    }

                    if (chavesA.Count > 13)
                    {
                        checkBox14.Visible = true;
                        checkBox14.Text    = chavesA[13].Nome;
                    }

                    if (chavesA.Count > 14)
                    {
                        checkBox15.Visible = true;
                        checkBox15.Text    = chavesA[14].Nome;
                    }

                    if (chavesA.Count > 15)
                    {
                        checkBox16.Visible = true;
                        checkBox16.Text    = chavesA[15].Nome;
                    }

                    if (chavesA.Count > 16)
                    {
                        checkBox17.Visible = true;
                        checkBox17.Text    = chavesA[16].Nome;
                    }

                    if (chavesA.Count > 17)
                    {
                        checkBox18.Visible = true;
                        checkBox18.Text    = chavesA[17].Nome;
                    }

                    if (chavesA.Count > 18)
                    {
                        checkBox19.Visible = true;
                        checkBox19.Text    = chavesA[18].Nome;
                    }

                    if (chavesA.Count > 19)
                    {
                        checkBox20.Visible = true;
                        checkBox20.Text    = chavesA[19].Nome;
                    }

                    if (chavesA.Count > 20)
                    {
                        checkBox21.Visible = true;
                        checkBox21.Text    = chavesA[20].Nome;
                    }

                    if (chavesA.Count > 21)
                    {
                        checkBox22.Visible = true;
                        checkBox22.Text    = chavesA[21].Nome;
                    }

                    if (chavesA.Count > 22)
                    {
                        checkBox23.Visible = true;
                        checkBox23.Text    = chavesA[22].Nome;
                    }

                    if (chavesA.Count > 23)
                    {
                        checkBox24.Visible = true;
                        checkBox24.Text    = chavesA[23].Nome;
                    }

                    if (chavesA.Count > 24)
                    {
                        checkBox25.Visible = true;
                        checkBox25.Text    = chavesA[24].Nome;
                    }

                    if (chavesA.Count > 25)
                    {
                        checkBox26.Visible = true;
                        checkBox26.Text    = chavesA[25].Nome;
                    }

                    if (chavesA.Count > 26)
                    {
                        checkBox27.Visible = true;
                        checkBox27.Text    = chavesA[26].Nome;
                    }

                    if (chavesA.Count > 27)
                    {
                        checkBox28.Visible = true;
                        checkBox28.Text    = chavesA[27].Nome;
                    }
                }
            }
        }
Ejemplo n.º 9
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            check = Shared.Get();
            Shared.Clean();

            CheckListBLL BLL = new CheckListBLL();

            chaves = BLL.ListaChaves();
            //int count = 0;
            if (chaves != null)
            {
                foreach (Chave p in chaves)
                {
                    if (p.Area.Equals(check.Area) && !p.Area.Equals("2"))
                    {
                        chavesA.Add(p);
                    }
                    if (p.Area.Equals("2"))
                    {
                        chavesA.Add(p);
                    }
                }

                //PARAMETROS PARA OS INTENS
                LayoutParams lp  = new LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                LayoutParams lpL = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);

                lp.Height = 120;

                //LAYOUT PRINCIPAL QUE IRÀ DENTRO DO SCROLL
                LinearLayout layout = new LinearLayout(this);
                layout.Orientation      = Orientation.Vertical;
                layout.LayoutParameters = lpL;
                //SCROLL DE ROLAGEM
                ScrollView scroll = new ScrollView(this);
                scroll.LayoutParameters = lpL;
                this.SetContentView(scroll);
                scroll.AddView(layout);



                TextView lblChaves = new TextView(this);
                lblChaves.Text = "Confira as Chaves!!!! =)";
                lblChaves.SetTextSize(Android.Util.ComplexUnitType.Sp, 30);

                //ADICIONAR TUDO AO LAYOUT
                layout.AddView(lblChaves, lp);


                Button botao = new Button(this);
                botao.Text = "CONCLUIR";



                if (chavesA != null)
                {
                    foreach (Chave a in chavesA)
                    {
                        Switch s = new Switch(this);
                        s.Text = a.Nome;
                        //try { s.Id = Convert.ToInt32(a.Id); } catch { }
                        s.SetTextSize(Android.Util.ComplexUnitType.Sp, 30);
                        switches.Add(s);
                    }
                }
                //for (int i = 0; i < 60; i++)
                //{
                //    Switch s = new Switch(this);
                //    s.Text = "Texto do Switch..:  " + i;
                //    s.SetTextSize(Android.Util.ComplexUnitType.Sp, 30);
                //    switches.Add(s);

                //}

                foreach (var s in switches)
                {
                    layout.AddView(s, lp);
                }


                layout.AddView(botao, lp);


                botao.Click += delegate {
                    Aguarde.MostraAguarde(true, this);
                    var task = Task.Factory.StartNew(() =>
                    {
                        certo = Cadastrar();
                    });
                    task.ContinueWith(
                        t =>
                    {
                        if (certo)
                        {
                            Toast.MakeText(this, "CHECKLIST FINALIZADO", ToastLength.Long).Show();
                            this.FinishAffinity();
                        }
                        else
                        {
                            Toast.MakeText(this, "VERIFIQUE OS CAMPOS OBRIGATÓRIOS", ToastLength.Long).Show();
                        }
                        Aguarde.MostraAguarde(false, this);
                    }, TaskScheduler.FromCurrentSynchronizationContext());

                    //
                };
            }
        }