protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_info); btnNext = (TextView)FindViewById(Resource.Id.btn_next); btnSkip = (TextView)FindViewById(Resource.Id.btn_skip); vpPager = (ViewPager)FindViewById(Resource.Id.vpPager); sessionManager = new Session_management(this); Android.Support.V4.App.FragmentManager fragmentManager = SupportFragmentManager; adapterViewPager = new MyPagerAdapter(fragmentManager); vpPager.Adapter = adapterViewPager; PageStepIndicator extensiblePageIndicator = (PageStepIndicator)FindViewById(Resource.Id.page_stepper); extensiblePageIndicator.SetupWithViewPager(vpPager); vpPager.SetOnPageChangeListener(this); btnNext.Click += BtnNext_Click; btnSkip.Click += BtnSkip_Click; if (sessionManager.getBooleanData()) { Intent intent = new Intent(this, typeof(MainActivity)); StartActivity(intent); Finish(); } ; }
public async void getCartDetails() { int UserId = 0; sessionManagement = new Session_management(this.Context); if (sessionManagement.isLoggedIn()) { UserId = Convert.ToInt32(sessionManagement.getUserDetails().Get(BaseURL.KEY_ID).ToString()); } var getDataUrl = new System.Uri(BaseURL.Get_CartList + UserId); var getCheckoutURL = new System.Uri(BaseURL.GetCheckoutList + UserId); using (var client = new HttpClient()) { var storeCartResponse = await client.GetStringAsync(getDataUrl); sessionManagement.SetStoreCart(storeCartResponse); MainActivity.totalBudgetCount.Text = JsonConvert.DeserializeObject <List <StoreCart> >(storeCartResponse).Count().ToString(); var checkoutData = await client.GetStringAsync(getCheckoutURL); sessionManagement.SetCheckout(checkoutData); } }
public void OnResponse(Java.Lang.Object response) { Log.Debug("Tag", response.ToString()); try { var result = JsonConvert.DeserializeObject <ResponseMessage>(response.ToString()); string message = result.message; string status = result.status; if (status.Contains("1")) { try { JSONObject obj = result.data; string partymaster_id = obj.GetString("partymasterid"); string user_id = obj.GetString("user_id"); string user_fullname = obj.GetString("user_name"); string user_email = obj.GetString("user_email"); string user_phone = obj.GetString("user_phone"); string password = obj.GetString("user_password"); Session_management sessionManagement = new Session_management(this.Context); ISharedPreferencesEditor editor = this.Context.GetSharedPreferences(BaseURL.MyPrefreance, FileCreationMode.Private).Edit(); editor.PutString(BaseURL.KEY_MOBILE, user_phone); editor.PutString(BaseURL.KEY_PASSWORD, password); editor.Apply(); sessionManagement.createLoginSession(partymaster_id, user_id, user_email, user_fullname, user_phone, password); Intent intent = new Intent(Context, typeof(MainActivity)); StartActivity(intent); Edit_profile_fragment fm = new Edit_profile_fragment(); Android.Support.V4.App.FragmentManager fragmentManager = FragmentManager; fragmentManager.BeginTransaction().Replace(Resource.Id.contentPanel, fm).AddToBackStack(null).Commit(); Toast.MakeText(Context, message, ToastLength.Short).Show(); } catch (Java.Lang.Exception e) { } Toast.MakeText(this.Context, "" + message, ToastLength.Short).Show(); } else { Toast.MakeText(this.Context, "" + message, ToastLength.Short).Show(); } } catch (JSONException e) { e.PrintStackTrace(); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_order_summary); SupportActionBar.Hide(); //this.Window.SetFlags(Android.Views.WindowManagerFlags.Fullscreen, Android.Views.WindowManagerFlags.Fullscreen); // Create your application here sessionManagement = new Session_management(ApplicationContext); user_id = sessionManagement.getUserDetails().Get(BaseURL.KEY_ID).ToString(); array = new JSONArray(); init(); }
public async void getCartData() { progressDialog = new Android.App.ProgressDialog(this.Context); progressDialog.Indeterminate = true; progressDialog.SetProgressStyle(ProgressDialogStyle.Spinner); progressDialog.SetMessage("Loading..."); progressDialog.SetCancelable(false); sessionManagement = new Session_management(this.Context); var UserId = Convert.ToInt32(sessionManagement.getUserDetails().Get(BaseURL.KEY_ID).ToString()); var getDataUrl = new System.Uri(BaseURL.Get_CartList + UserId); using (var client = new HttpClient()) { progressDialog.Show(); var storeCartResponse = await client.GetStringAsync(getDataUrl); sessionManagement.SetStoreCart(storeCartResponse); StoreCartData = JsonConvert.DeserializeObject <List <StoreCart> >(storeCartResponse); if (sessionManagement.isLoggedIn()) { if (StoreCartData.Count == 0) { noData.Visibility = ViewStates.Visible; viewCart.Visibility = ViewStates.Gone; } } else { if (StoreCartData.Count == 0) { noData.Visibility = ViewStates.Visible; viewCart.Visibility = ViewStates.Gone; } } updateData(); progressDialog.Dismiss(); } Cart_adapter adapter = new Cart_adapter(this.Activity, StoreCartData); recyclerView.SetAdapter(adapter); adapter.NotifyDataSetChanged(); }
public async void Setup() { address = (EditText)FindViewById(Resource.Id.input_HouseNO); countrySpiner = FindViewById <Spinner>(Resource.Id.countryspinner); statespinner = FindViewById <Spinner>(Resource.Id.statespinner); city = (EditText)FindViewById(Resource.Id.input_city); pinCode = (EditText)FindViewById(Resource.Id.input_pinCode); remark = (EditText)FindViewById(Resource.Id.input_remark); specialRemark = (EditText)FindViewById(Resource.Id.input_specialRmk); name = (EditText)FindViewById(Resource.Id.input_NAme); email = (EditText)FindViewById(Resource.Id.input_Email); mobNo = (EditText)FindViewById(Resource.Id.input_mobNO); alterMob = (EditText)FindViewById(Resource.Id.input_AltermobileNO); session_management = new Session_management(this); address.Text = session_management.GetAddressDetails().Get(BaseURL.ADDRESS).ToString(); city.Text = session_management.GetAddressDetails().Get(BaseURL.CITY).ToString(); pinCode.Text = session_management.GetAddressDetails().Get(BaseURL.PINCODE).ToString(); name.Text = session_management.GetAddressDetails().Get(BaseURL.FULLNAME).ToString(); email.Text = session_management.GetAddressDetails().Get(BaseURL.EMAIL).ToString(); mobNo.Text = session_management.GetAddressDetails().Get(BaseURL.MOBILE).ToString(); progressDialog = new ProgressDialog(this); progressDialog.SetMessage("Loading..."); progressDialog.SetCancelable(false); RunOnUiThread(() => { GetCountryList(); }); back = (LinearLayout)FindViewById(Resource.Id.back); Save = (Button)FindViewById(Resource.Id.SaveBtn); EditBtn = (Button)FindViewById(Resource.Id.EditBtn); back.Click += delegate { Finish(); }; Save.Click += Save_Click; }
private async void init() { session_management = new Session_management(this.ApplicationContext); progressDialog = new ProgressDialog(this); progressDialog.SetMessage("Loading..."); progressDialog.SetCancelable(false); sessionManagement = new Session_management(this); sessionManagement.cleardatetime(); dname = Intent.GetStringExtra("dName"); addressid = Intent.GetStringExtra("dId"); btn_AddAddress = (Button)FindViewById(Resource.Id.btn_AddAddress); txtTotalItems = (TextView)FindViewById(Resource.Id.txtTotalItems); btn_Contine = (TextView)FindViewById(Resource.Id.btn_Contine); recycler_itemsList = (RecyclerView)FindViewById(Resource.Id.recycler_itemsList); //recyclerTimeSlot = (RecyclerView)FindViewById(Resource.Id.recyclerTimeSlot); pPrice = (TextView)FindViewById(Resource.Id.pPrice); pMrp = (TextView)FindViewById(Resource.Id.pMrp); totalItms = (TextView)FindViewById(Resource.Id.totalItms); price = (TextView)FindViewById(Resource.Id.price); DeliveryCharge = (TextView)FindViewById(Resource.Id.DeliveryCharge); Amounttotal = (TextView)FindViewById(Resource.Id.Amounttotal); txt_totalPrice = (TextView)FindViewById(Resource.Id.txt_totalPrice); back = (LinearLayout)FindViewById(Resource.Id.back); back.Click += delegate { Finish(); }; btn_AddAddress.Click += delegate { Intent In = new Intent(ApplicationContext, typeof(Add_address)); StartActivity(In); }; SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy"); var startDate = DateTime.Now.AddMonths(-1); Date sdate = format.Parse(startDate.Date.ToShortDateString()); var endDate = DateTime.Now.AddMonths(1); Date edate = format.Parse(endDate.Date.ToShortDateString()); string todaydate = sdate.ToString(); dateDayModelClasses1 = new List <timing_model>(); //horizontalCalendar = FindViewById<HorizontalCalendar>(Resource.Id.calendarView1); //horizontalCalendar = new HorizontalCalendar.Builder(this, Resource.Id.calendarView1) // .StartDate(sdate) // .EndDate(edate) // .DatesNumberOnScreen(5) // .MonthFormat("MMM") // .DayNameFormat("dd") // .DayNumberFormat("EEE") // .TextSize(11f, 20f, 12f) // .TextColor(Color.Gray, Color.Black) // .Build(); //horizontalCalendarListner = new OnDateSelected(DateSelected); sessionManagement = new Session_management(this); var UserId = Convert.ToInt32(sessionManagement.getUserDetails().Get(BaseURL.KEY_ID).ToString()); var getCheckoutURL = new System.Uri(BaseURL.GetCheckoutList + UserId); CheckoutList = new List <ProcessCheckout>(); using (var client = new HttpClient()) { var checkoutData = await client.GetStringAsync(getCheckoutURL); CheckoutList = JsonConvert.DeserializeObject <List <ProcessCheckout> >(checkoutData); var deliverycharges = CheckoutList.Select(x => x.ShippingCharges).Sum(); DeliveryCharge.Text = deliverycharges.ToString(); totalprice = DeliveryCharge.Text.ToString() + price.Text.ToString(); Amounttotal.Text = totalprice; } updateData(); btn_Contine.Click += Btn_Contine_Click; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View view = inflater.Inflate(Resource.Layout.fragment_edit_profile, container, false); sharedPreferences = this.Context.GetSharedPreferences("User_profile", FileCreationMode.Private); editor = sharedPreferences.Edit(); ((MainActivity)this.Activity).Title = "Edit Profile"; Email_Status = sharedPreferences.GetBoolean("Email", true); Sms_Status = sharedPreferences.GetBoolean("Sms", true); In_App = sharedPreferences.GetBoolean("App", true); sessionManagement = new Session_management(this.Activity); user_id = sessionManagement.getUserDetails().Get(BaseURL.KEY_ID).ToString(); et_phone = (EditText)view.FindViewById(Resource.Id.et_pro_phone); et_name = (EditText)view.FindViewById(Resource.Id.et_pro_name); et_email = (EditText)view.FindViewById(Resource.Id.et_pro_email); btn_update = (RelativeLayout)view.FindViewById(Resource.Id.btn_pro_edit); getemail = sessionManagement.getUserDetails().Get(BaseURL.KEY_EMAIL).ToString(); getpassword = sessionManagement.getUserDetails().Get(BaseURL.KEY_PASSWORD).ToString(); getname = sessionManagement.getUserDetails().Get(BaseURL.KEY_NAME).ToString(); getphone = sessionManagement.getUserDetails().Get(BaseURL.KEY_MOBILE).ToString(); getid = sessionManagement.getUserDetails().Get(BaseURL.KEY_ID).ToString(); et_name.Text = getname; et_phone.Text = getphone; et_email.Text = getemail; update_profile = (TextView)view.FindViewById(Resource.Id.update_profile); circle1 = (CardView)view.FindViewById(Resource.Id.circle1); circle2 = (CardView)view.FindViewById(Resource.Id.circle2); circle3 = (CardView)view.FindViewById(Resource.Id.circle3); circle4 = (CardView)view.FindViewById(Resource.Id.circle4); circle5 = (CardView)view.FindViewById(Resource.Id.circle5); circle6 = (CardView)view.FindViewById(Resource.Id.circle6); if (Email_Status) { circle1.SetCardBackgroundColor(Resource.Color.colorPrimaryDark); circle2.SetCardBackgroundColor(Resource.Color.grey); circle1.Enabled = false; circle2.Enabled = true; } else { circle2.SetCardBackgroundColor(Resource.Color.colorPrimaryDark); circle1.SetCardBackgroundColor(Resource.Color.grey); circle2.Enabled = false; circle1.Enabled = true; } if (Sms_Status) { circle3.SetCardBackgroundColor(Resource.Color.colorPrimaryDark); circle4.SetCardBackgroundColor(Resource.Color.grey); circle3.Enabled = false; circle4.Enabled = true; } else { circle4.SetCardBackgroundColor(Resource.Color.colorPrimaryDark); circle3.SetCardBackgroundColor(Resource.Color.grey); circle4.Enabled = false; circle3.Enabled = true; } if (In_App) { circle5.SetCardBackgroundColor(Resource.Color.colorPrimaryDark); circle6.SetCardBackgroundColor(Resource.Color.grey); circle5.Enabled = false; circle6.Enabled = true; } else { circle6.SetCardBackgroundColor(Resource.Color.colorPrimaryDark); circle5.SetCardBackgroundColor(Resource.Color.grey); circle6.Enabled = false; circle5.Enabled = true; } update_profile.Click += delegate { string email_, sms_; editor.PutBoolean("Email", Email_Status); editor.PutBoolean("Sms", Sms_Status); editor.PutBoolean("App", In_App); editor.Commit(); editor.Apply(); //recreate(); if (Email_Status) { email_ = "1"; } else { email_ = "0"; } if (Sms_Status) { sms_ = "1"; } else { sms_ = "0"; } if (In_App) { sms_ = "1"; } else { sms_ = "0"; } Notif(user_id, email_, "1", sms_); }; circle1.Click += delegate { circle1.SetCardBackgroundColor(Resource.Color.colorPrimaryDark); circle2.SetCardBackgroundColor(Resource.Color.grey); circle1.Enabled = (false); Email_Status = true; circle2.Enabled = (true); }; circle2.Click += delegate { Email_Status = false; circle2.SetCardBackgroundColor(Resource.Color.colorPrimaryDark); circle1.SetCardBackgroundColor(Resource.Color.grey); circle2.Enabled = (false); circle1.Enabled = (true); }; circle3.Click += delegate { Sms_Status = true; circle3.SetCardBackgroundColor(Resource.Color.colorPrimaryDark); circle4.SetCardBackgroundColor(Resource.Color.grey); circle3.Enabled = (false); circle4.Enabled = (true); }; circle4.Click += delegate { Sms_Status = false; circle4.SetCardBackgroundColor(Resource.Color.colorPrimaryDark); circle3.SetCardBackgroundColor(Resource.Color.grey); circle4.Enabled = (false); circle3.Enabled = (true); }; circle5.Click += delegate { In_App = true; circle5.SetCardBackgroundColor(Resource.Color.colorPrimaryDark); circle6.SetCardBackgroundColor(Resource.Color.grey); circle5.Enabled = (false); circle6.Enabled = (true); }; circle6.Click += delegate { In_App = false; circle6.SetCardBackgroundColor(Resource.Color.colorPrimaryDark); circle5.SetCardBackgroundColor(Resource.Color.grey); circle6.Enabled = (false); circle5.Enabled = (true); }; if (!TextUtils.IsEmpty(getemail)) { et_email.Text = getemail; } btn_update.SetOnClickListener(this); return(view); }
public Cart_adapter(Activity activity, List <StoreCart> list) { this.list = list; this.activity = activity; sessionManagement = new Session_management(activity); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View view = inflater.Inflate(Resource.Layout.fragment_cart, container, false); recyclerView = (RecyclerView)view.FindViewById(Resource.Id.recyclerCart); btn_ShopNOw = (Button)view.FindViewById(Resource.Id.btn_ShopNOw); viewCart = (RelativeLayout)view.FindViewById(Resource.Id.viewCartItems); tv_total = (TextView)view.FindViewById(Resource.Id.txt_totalamount); totalItems = (TextView)view.FindViewById(Resource.Id.txt_totalQuan); noData = (RelativeLayout)view.FindViewById(Resource.Id.noData); ((MainActivity)this.Activity).Title = (GetString(Resource.String.cart)); sessionManagement = new Session_management(Activity); sessionManagement.cleardatetime(); ll_Checkout = (LinearLayout)view.FindViewById(Resource.Id.ll_Checkout); getCartData(); btn_ShopNOw.Click += delegate { Intent intent = new Intent(Activity, typeof(MainActivity)); StartActivity(intent); }; ll_Checkout.Click += async delegate { if (isOnline()) { if (sessionManagement.isLoggedIn()) { if (StoreCartData.Count == 0) { noData.Visibility = ViewStates.Visible; viewCart.Visibility = ViewStates.Gone; } else { progressDialog = new Android.App.ProgressDialog(this.Context); progressDialog.Indeterminate = true; progressDialog.SetProgressStyle(ProgressDialogStyle.Spinner); progressDialog.SetMessage("Loading..."); progressDialog.SetCancelable(false); progressDialog.Show(); int UserId = 0; if (sessionManagement.isLoggedIn()) { UserId = Convert.ToInt32(sessionManagement.getUserDetails().Get(BaseURL.KEY_ID).ToString()); } var processCheckout = BaseURL.ProcessToCheckout + UserId; using (var client = new HttpClient()) { StringContent content = new StringContent(""); var response = await client.PostAsync(processCheckout, content); if (response.StatusCode == HttpStatusCode.OK) { Intent intent = new Intent(this.Activity, typeof(OrderSummary)); StartActivity(intent); } } } } else { if (StoreCartData.Count == 0) { noData.Visibility = ViewStates.Visible; viewCart.Visibility = ViewStates.Gone; } else { Intent intent = new Intent(this.Activity, typeof(OrderSummary)); StartActivity(intent); } } } ; }; recyclerView.SetLayoutManager(new LinearLayoutManager(Activity)); updateData(); return(view); }
public CartAdapter(Context context, List <CartModel> cartList) { this.cartList = cartList; this.context = context; sessionManagement = new Session_management(context); }