public DataForLeftMenu req(DataForLeftMenu Dsql1) { WebRequest request1 = WebRequest.Create("http://192.168.56.1/WebApplication1/Home/GetImageFullname"); request1.Method = "POST"; string idS = Sessions.GetSession(); string data1 = "id=" + idS; byte[] byteArray1 = System.Text.Encoding.UTF8.GetBytes(data1); request1.ContentType = "application/x-www-form-urlencoded"; request1.ContentLength = byteArray1.Length; using (System.IO.Stream dataStream = request1.GetRequestStream()) { dataStream.Write(byteArray1, 0, byteArray1.Length); } WebResponse response1 = request1.GetResponse(); string json_string1 = ""; using (System.IO.Stream stream = response1.GetResponseStream()) { using (StreamReader reader = new StreamReader(stream)) { json_string1 = reader.ReadToEnd(); } } Dsql1 = JsonConvert.DeserializeObject <DataForLeftMenu>(json_string1); response1.Close(); return(Dsql1); }
protected override void OnCreate(Bundle savedInstanceState) { image = Intent.GetStringExtra("image"); Name = Intent.GetStringExtra("Name"); Secondname = Intent.GetStringExtra("Secondname"); base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_mainChat); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); //FloatingActionButton fab = FindViewById<FloatingActionButton>(Resource.Id.fab); //fab.Click += FabOnClick; DrawerLayout drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close); drawer.AddDrawerListener(toggle); toggle.SyncState(); NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); View hv = navigationView.GetHeaderView(0); Fullname = hv.FindViewById <TextView>(Resource.Id.Fullname); id = hv.FindViewById <TextView>(Resource.Id.ID); imageSrc = hv.FindViewById <ImageView>(Resource.Id.imageView); navigationView.SetNavigationItemSelectedListener(this); Dsql1 = req(Dsql1); ChatBarView chb = FindViewById <ChatBarView>(Resource.Id.chatbar); chb.SetMessageBoxHint("Введите сообщение.."); string Full = Dsql1.Secondname + " " + Dsql1.Name; Fullname.Text = Full; id.Text = "ID - " + Sessions.GetSession(); int resourceId = (int)typeof(Resource.Drawable).GetField(Dsql1.image).GetValue(null); imageSrc.SetImageResource(resourceId); ImageView img_top = (ImageView)FindViewById(Resource.Id.image_chat); TextView txt = (TextView)FindViewById(Resource.Id.Fname); int resourceId1 = (int)typeof(Resource.Drawable).GetField(image).GetValue(null); img_top.SetImageResource(resourceId1); txt.Text = Secondname + " " + Name; Sqlchat = GetMessages(Sqlchat); recycler = FindViewById <RecyclerView>(Resource.Id.recycler); recycler.HasFixedSize = true; layoutManager = new LinearLayoutManager(this); recycler.SetLayoutManager(layoutManager); adapter = new RecyclerViewAdapterChat(Sqlchat, this); recycler.SetAdapter(adapter); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_mainInfo); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); DrawerLayout drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close); drawer.AddDrawerListener(toggle); toggle.SyncState(); NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); View hv = navigationView.GetHeaderView(0); Fullname = hv.FindViewById <TextView>(Resource.Id.Fullname); id = hv.FindViewById <TextView>(Resource.Id.ID); imageSrc = hv.FindViewById <ImageView>(Resource.Id.imageView); navigationView.SetNavigationItemSelectedListener(this); /*Zakdoc = (TextView)FindViewById(Resource.Id.Zakdoc); * HistRSO = (TextView)FindViewById(Resource.Id.histRSO); * otrhist = (TextView)FindViewById(Resource.Id.Histotr); * obrp = (TextView)FindViewById(Resource.Id.obrp); * Zakdoc.SetOnClickListener(this); * HistRSO.SetOnClickListener(this); * otrhist.SetOnClickListener(this); * obrp.SetOnClickListener(this);*/ Dsql1 = req(Dsql1); string Full = Dsql1.Secondname + " " + Dsql1.Name; Fullname.Text = Full; string idS = Sessions.GetSession(); id.Text = "ID - " + idS; int resourceId = (int)typeof(Resource.Drawable).GetField(Dsql1.image).GetValue(null); imageSrc.SetImageResource(resourceId); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_main); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab); fab.Click += FabOnClick; DrawerLayout drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close); drawer.AddDrawerListener(toggle); toggle.SyncState(); NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); View hv = navigationView.GetHeaderView(0); Fullname = hv.FindViewById <TextView>(Resource.Id.Fullname); id = hv.FindViewById <TextView>(Resource.Id.ID); imageSrc = hv.FindViewById <ImageView>(Resource.Id.imageView); navigationView.SetNavigationItemSelectedListener(this); Dsql1 = req(Dsql1); string Full = Dsql1.Secondname + " " + Dsql1.Name; Fullname.Text = Full; id.Text = "ID - 7777777"; int resourceId = (int)typeof(Resource.Drawable).GetField(Dsql1.image).GetValue(null); imageSrc.SetImageResource(resourceId); InitData(); recycler = FindViewById <RecyclerView>(Resource.Id.recycler); recycler.HasFixedSize = true; layoutManager = new LinearLayoutManager(this); recycler.SetLayoutManager(layoutManager); adapter = new RecViewAdapterMessage(lstData, this); adapter.ItemClick += OnItemClick; recycler.SetAdapter(adapter); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_mainProfile); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab); fab.Click += FabOnClick; DrawerLayout drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close); drawer.AddDrawerListener(toggle); toggle.SyncState(); NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); View hv = navigationView.GetHeaderView(0); Fullname = hv.FindViewById <TextView>(Resource.Id.Fullname); id = hv.FindViewById <TextView>(Resource.Id.ID); imageSrc = hv.FindViewById <ImageView>(Resource.Id.imageView); navigationView.SetNavigationItemSelectedListener(this); Dsql1 = req(Dsql1); string Full = Dsql1.Secondname + " " + Dsql1.Name; Fullname.Text = Full; string idS = Sessions.GetSession(); id.Text = "ID - " + idS; int resourceId = (int)typeof(Resource.Drawable).GetField(Dsql1.image).GetValue(null); imageSrc.SetImageResource(resourceId); Dsql = Info(Dsql); //TextView ChangeFam = (TextView)FindViewById(Resource.Id.change_fam); //ChangeFam.SetOnClickListener(this); Login = FindViewById <TextView>(Resource.Id.Login); ID = FindViewById <TextView>(Resource.Id.ID); Secondname = FindViewById <TextView>(Resource.Id.Secondname); Name = FindViewById <TextView>(Resource.Id.Name); Fathersname = FindViewById <TextView>(Resource.Id.Fathersname); date = FindViewById <TextView>(Resource.Id.Date); otr = FindViewById <TextView>(Resource.Id.Otr); role = FindViewById <TextView>(Resource.Id.Role); img = FindViewById <ImageView>(Resource.Id.iconProfile); Login.Text = Dsql.Login; ID.Text = "ID - " + Sessions.GetSession(); Secondname.Text = Dsql.Secondname; Name.Text = Dsql.Name; Fathersname.Text = Dsql.Fathersname; date.Text = Dsql.Date; otr.Text = Dsql.otr; role.Text = Dsql.role; int resourceId1 = (int)typeof(Resource.Drawable).GetField(Dsql.image).GetValue(null); img.SetImageResource(resourceId1); }
protected override void OnCreate(Bundle savedInstanceState) { image = Intent.GetStringExtra("image"); base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_mainInfoEvents); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); // FloatingActionButton fab = FindViewById<FloatingActionButton>(Resource.Id.fab); // fab.Click += FabOnClick; DrawerLayout drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close); drawer.AddDrawerListener(toggle); toggle.SyncState(); NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); View hv = navigationView.GetHeaderView(0); Fullname = hv.FindViewById <TextView>(Resource.Id.Fullname); id = hv.FindViewById <TextView>(Resource.Id.ID); imageSrc = hv.FindViewById <ImageView>(Resource.Id.imageView); navigationView.SetNavigationItemSelectedListener(this); Dsql1 = req(Dsql1); string Full = Dsql1.Secondname + " " + Dsql1.Name; Fullname.Text = Full; id.Text = "ID - " + Sessions.GetSession(); int resourceId = (int)typeof(Resource.Drawable).GetField(Dsql1.image).GetValue(null); imageSrc.SetImageResource(resourceId); DsqlEv = GetEventsInfo(DsqlEv, image); LLBack = (LinearLayout)FindViewById(Resource.Id.LLBackInfoEvent); Name = (TextView)FindViewById(Resource.Id.NameEventsInfo); Descriptions = (TextView)FindViewById(Resource.Id.DescEventsInfo); Date = (TextView)FindViewById(Resource.Id.DataEvent); Time = (TextView)FindViewById(Resource.Id.Timestart); Place = (TextView)FindViewById(Resource.Id.PlaceEvent); //Count = (TextView)FindViewById(Resource.Id.CountEvent); int resourceId1 = (int)typeof(Resource.Drawable).GetField(image).GetValue(null); LLBack.SetBackgroundResource(resourceId1); Name.Text = DsqlEv.Name; Descriptions.Text = DsqlEv.Descriptions; Date.Text = DsqlEv.Date; Time.Text = DsqlEv.Time; Place.Text = DsqlEv.Place; // Count.Text = DsqlEv.Count; Visit = (TextView)FindViewById(Resource.Id.Visits); org = (TextView)FindViewById(Resource.Id.org); if (DsqlEv.Status == "0") { Visit.Text = "Стать участником"; org.Text = "Стать организатором"; } else if (DsqlEv.Status == "1") { Visit.Text = "Покинуть мероприятие"; org.Text = "Стать организатором"; } else if (DsqlEv.Status == "2") { Visit.Text = "Стать участником"; org.Text = "Покинуть статус организатора"; } Visit.SetOnClickListener(this); }