예제 #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.LayDeathAdd);


            txtfname  = FindViewById <EditText> (Resource.Id.txtfname);
            txtlname  = FindViewById <EditText> (Resource.Id.txtlname);
            txtexname = FindViewById <EditText> (Resource.Id.txtexname);
            txtbday   = FindViewById <EditText> (Resource.Id.txtageatdeath);

            spngender        = FindViewById <Spinner> (Resource.Id.spngender);
            spndeathcert     = FindViewById <Spinner> (Resource.Id.spndeathcert);
            spnregisterdeath = FindViewById <Spinner> (Resource.Id.spnregisterdeath);


            var adaptergender = ArrayAdapter.CreateFromResource(
                this, Resource.Array.Gender_Spinner, Android.Resource.Layout.SimpleSpinnerItem);

            adaptergender.SetDropDownViewResource(Android.Resource.Layout.SimpleListItemActivated1);
            spngender.Adapter = adaptergender;

            var adpdeathcert = ArrayAdapter.CreateFromResource(
                this, Resource.Array.Death_certificate, Android.Resource.Layout.SimpleSpinnerItem);

            adpdeathcert.SetDropDownViewResource(Android.Resource.Layout.SimpleListItemActivated1);
            spndeathcert.Adapter = adpdeathcert;

            var adpregisterdeath = ArrayAdapter.CreateFromResource(
                this, Resource.Array.Death_register, Android.Resource.Layout.SimpleSpinnerItem);

            adpregisterdeath.SetDropDownViewResource(Android.Resource.Layout.SimpleListItemActivated1);
            spnregisterdeath.Adapter = adpregisterdeath;

            var items = ConDeath.GetListSingle("select * from tblDeath where id='" + Intent.GetStringExtra("death_id") + "'");

            txtfname.Text  = items.fname;
            txtlname.Text  = items.lname;
            txtexname.Text = items.ename;
            txtbday.Text   = items.age_death;

            string[] array;
            array = Resources.GetStringArray(Resource.Array.Gender_Spinner);
            fcnspinner(spngender, array, items.gender);

            array = Resources.GetStringArray(Resource.Array.Death_certificate);
            fcnspinner(spndeathcert, array, items.birthcertificate);
            array = Resources.GetStringArray(Resource.Array.Death_register);
            fcnspinner(spnregisterdeath, array, items.register);

            btnAddaddress        = FindViewById <Button> (Resource.Id.btnAddAddress);
            btnAddaddress.Click += new EventHandler(btnAddaddress_Clicked);
        }
예제 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.LayDeathView);


            txtfname         = FindViewById <EditText> (Resource.Id.txtfname);
            txtlname         = FindViewById <EditText> (Resource.Id.txtlname);
            txtexname        = FindViewById <EditText> (Resource.Id.txtexname);
            txtgender        = FindViewById <EditText> (Resource.Id.txtgender);
            txtageatdeath    = FindViewById <EditText> (Resource.Id.txtageatdeath);
            txtcopydeathcert = FindViewById <EditText> (Resource.Id.txtcopydeathcert);
            txtdeathreg      = FindViewById <EditText> (Resource.Id.txtdeathreg);

            var items = ConDeath.GetListSingle("select * from tblDeath where id='" + Intent.GetStringExtra("death_id") + "'");

            txtfname.Text         = items.fname;
            txtlname.Text         = items.lname;
            txtexname.Text        = items.ename;
            txtageatdeath.Text    = items.age_death;
            txtgender.Text        = items.gender;
            txtcopydeathcert.Text = items.birthcertificate;
            txtdeathreg.Text      = items.register;
        }