public ActionResult RegisterOrder(OrderModel ordermodel) { using (UserDataBase userContext = new UserDataBase()) { if (ModelState.IsValid) { int total = 0; var user = userContext.user.Find((int)Session["UserId"]); Orders registration = Mapper.Map <OrderModel, Orders>(ordermodel); foreach (var Item in (List <CartModel>)Session["cart"]) { registration.CartId = user.UserId + "/" + user.CellNumber; registration.UserMail = user.Email; registration.UserId = user.UserId; int lineTotal = Convert.ToInt32(Item.Quantity * Item.Price); int Price = Convert.ToInt32(total + lineTotal); registration.ProductName = Item.ProductName; registration.Quantity = Item.Quantity; registration.ProductId = Item.ProductId; registration.Price = lineTotal; if (userManager.ToRegisterOrder(registration) == true) { TempData["Message"] = "Registered Sucessfully"; } } return(RedirectToAction("CustomerHome", "Customer")); } } TempData["Message"] = "Try Again"; return(View()); }
private void btnUpdate_Clicked(object sender, EventArgs e) { if (string.IsNullOrEmpty(ent1.Text)) { ent1.Focus(); } else if (string.IsNullOrEmpty(ent2.Text)) { ent2.Focus(); } else { userDataBase = new UserDataBase(); var user_exist = userDataBase.GetMembers().ToList(); var idx = user_exist[0].id_cliente; HttpClient client = new HttpClient(); var uri = "http://washdryapp.com/app/public/cliente/actualiza"; var value_check = new Dictionary <string, string> { { "id_usuario", idx.ToString() } }; var content = new FormUrlEncodedContent(value_check); } }
public ActionResult DecreaseQuantity(int id) { using (UserDataBase userContext = new UserDataBase()) { if (Session["cart"] != null) { List <CartModel> cart = (List <CartModel>)Session["cart"]; var product = userContext.product.Find(id); foreach (var item in cart) { if (item.ProductId == id) { int tempquantity = item.Quantity; if (tempquantity > 0) { cart.Remove(item); cart.Add(new CartModel() { ProductName = product.ProductName, Quantity = tempquantity - 1, ProductId = product.ProductId, Price = product.Price }); } break; } } Session["cart"] = cart; } } return(RedirectToAction("AddToCartCustomerDisplay")); }
public Solicitar() { InitializeComponent(); stepBar.Opacity = 0; stepBar.FadeTo(1, 1000, null); stepBar.ScaleTo(1, 1000); //local: StepProgressBarControl frame1.IsVisible = true; frame2.IsVisible = false; frame3.IsVisible = false; frame4.IsVisible = false; frame5.IsVisible = false; userDataBase = new UserDataBase(); var user_exist = userDataBase.GetMembers().ToList(); idx = user_exist[0].id_cliente; _ = getdireccion(); _ = getAutos(); _ = CurrentLocation(); _ = getPaquetes(); _ = getWashers(); string hour = DateTime.Now.ToString("HH"); string minute = DateTime.Now.ToString("mm"); string sencond = DateTime.Now.ToString("ss"); _timePicker.Time = new TimeSpan(Convert.ToInt32(hour), Convert.ToInt32(minute), Convert.ToInt32(sencond)); FDPPicker.SelectedIndexChanged += FDPPickerSelectedIndexChanged; pickertamanio.SelectedIndexChanged += TamPickerSelected; }
//[Obsolete] public MainPage() { InitializeComponent(); userDataBase = new UserDataBase(); var user_exist = userDataBase.GetMembers(); int RowCount = 0; int usercount = user_exist.Count(); RowCount = Convert.ToInt32(usercount); if (RowCount > 0) { var userLite = user_exist.First(); var id = userLite.id; CallDataTCUser(id); } else { Application.Current.MainPage = new Views.SignInPage(); } //listMembers.ItemsSource = members; }
protected override async void OnAppearing() { if (!CrossConnectivity.Current.IsConnected) { //ErrorBtn.IsVisible = true; await DisplayAlert("Error", "Por favor activa tus datos o conectate a una red", "ok"); } if (!CrossGeolocator.IsSupported) { await DisplayAlert("Error", "Ha habido un error con el plugin", "ok"); } userDataBase = new UserDataBase(); var solicitudes = userDataBase.GetSolicitudes().ToList(); Mapx.Pins.Clear(); if (solicitudes.Count() > 0) { ListSolicitudes.ItemsSource = solicitudes; _ = CurrentLocation(); ListSolicitudes.IsVisible = true; lblestados.IsVisible = true; } else { _ = CurrentLocation(); lblestados.IsVisible = false; ListSolicitudes.IsVisible = false; } }
private void btnCerrarSession_Clicked(object sender, EventArgs e) { userDataBase = new UserDataBase(); var user_exist = userDataBase.GetMembers().ToList(); var idx = user_exist[0].id; var tok = user_exist[0].token; var userW = new User(); userW.id_cliente = 0; userW.name = ""; userW.nombre = ""; userW.password = ""; userW.username = ""; userW.remember_token = ""; userW.google_id = ""; userW.email = ""; userW.token = tok; userW.status = 0; userDataBase.DeleteMember(idx); userDataBase.AddMember(userW); Application.Current.MainPage = new NavigationPage(new Login()); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); //Enable Back Navigation in Bar AppCompatActivity activity = (AppCompatActivity)Activity; activity.SupportActionBar.SetDisplayHomeAsUpEnabled(true); activity.SupportActionBar.SetHomeButtonEnabled(true); activity.SupportActionBar.Title = GetString(Resource.String.ChangeUserData); activity.SupportActionBar.SetDisplayUseLogoEnabled(false); //Inflate View var view = inflater.Inflate(Resource.Layout.DialogChangeUserData, container, false); //Load DB _userDataBase = new UserDataBase(); _userDataBase.CreateDataBase(); //Find views _editUserName = view.FindViewById <EditText>(Resource.Id.txtUserName); _editOldPassword = view.FindViewById <EditText>(Resource.Id.txtOldPassword); _editNewPassword = view.FindViewById <EditText>(Resource.Id.txtNewPassword); _buttonPositive = view.FindViewById <Button>(Resource.Id.buttonPositve); _buttonNegative = view.FindViewById <Button>(Resource.Id.buttonNegative); //Setup Text _editUserName.Text = MainActivity.UserName; //Set ClickFunction _buttonPositive.Click += _buttonPositive_Click; _buttonNegative.Click += _buttonNegative_Click; return(view); }
public void CreatePlayerData(string player_Name, string player_sprite_name) { FileDataInterface testUSerDB = new UserDataBase(); userDB.setUserData(player_Name, player_sprite_name); // userDB.SaveData(); }
public Test() { InitializeComponent(); userDb = new UserDataBase(); var users = userDb.GetMembers(); //userView.ItemsSource = users; }
public master() { InitializeComponent(); userDataBase = new UserDataBase(); var user_exist = userDataBase.GetMembers().ToList(); namelbl.Text = user_exist[0].name + user_exist[0].id_cliente; InfoUserweb(user_exist[0].id); }
public void ConfirmRegistration() { UserDataBase usersDataBase = new UserDataBase(); usersDataBase.Insert(regName, regEmail, regHash_password, regTypeId); RegistrationDataBase registrationDataBase = new RegistrationDataBase(); registrationDataBase.Delete(regName); }
public Agendar() { InitializeComponent(); db = new UserDataBase(); var user_exist = db.GetMembers().ToList(); idx = user_exist[0].id_cliente; }
public ActionResult <IEnumerable <User> > Get() { var ListUser = UserDataBase.GetListUser(); if (ListUser == null) { return(BadRequest()); } return(Ok(ListUser)); }
public LavadorInfo() { InitializeComponent(); userDataBase = new UserDataBase(); var user_exist = userDataBase.GetMembers().ToList(); idx = user_exist[0].id_cliente; _ = getSolicitudStatis(); }
public IActionResult Post([FromBody] User user) { if (ModelState.IsValid) { if (!UserDataBase.AddUser(user)) { return(BadRequest()); } return(Created(Url.Action("Post", user.Email), user)); } return(BadRequest()); }
public IActionResult Put([FromBody] User user) { if (ModelState.IsValid) { if (!UserDataBase.UpdateUser(user)) { return(BadRequest()); } return(Ok(user)); } return(BadRequest()); }
public async Task GetVisitasWeb() { try { userDataBase = new UserDataBase(); var user_exist = userDataBase.GetMembers().ToList(); HttpClient client = new HttpClient(); var uri = "http://www.washdryapp.com/app/public/direccion/listado/" + user_exist[0].id; var responseMsg = await client.GetAsync(uri); switch (responseMsg.StatusCode) { case System.Net.HttpStatusCode.InternalServerError: Console.WriteLine("----------------------------------------------_____:Here status 500"); //xlabel.Text = "error 500"; // Cator.IsVisible = false; break; case System.Net.HttpStatusCode.OK: Console.WriteLine("----------------------------------------------_____:Here status 200"); // ylabel.Text = "Ultimas noticas de proyectos"; // var json_ = JsonConvert.DeserializeObject<List<VisitasMod>>(xjson); string xjson = await responseMsg.Content.ReadAsStringAsync(); //DireccApiCall HttpContent contentD = responseMsg.Content; var xjsonD = await contentD.ReadAsStringAsync(); var json_d = JsonConvert.DeserializeObject <List <DireccionesApiCall> >(xjsonD); ListDirecciones.ItemsSource = json_d; break; } } catch (Exception ex) { await DisplayAlert("", "" + ex.ToString(), "ok"); // Cator.IsVisible = false; // CatorT.Text = "Ha habido un error"; return; } }
public LoginWebServices() { var accounts = new User[] { new User("Alex1", "*****@*****.**", "1234"), new User("Alex2", "*****@*****.**", "1234"), new User("Alex3", "*****@*****.**", "1234") }; _userDataBase = new UserDataBase(accounts); _authenticatorByName = new AuthenticatorByName(_userDataBase); _authenticatorByEmail = new AuthenticatorByEmail(_userDataBase); }
//Termina diseño // BackEnd public async void TryAccess_token() { userDataBase = new UserDataBase(); var user_exist = userDataBase.GetMembers(); int RowCount = 0; int usercount = user_exist.Count(); RowCount = Convert.ToInt32(usercount); if (RowCount > 0) { var userLite = user_exist.First(); var tokenCheck = userLite.tok; HttpClient client = new HttpClient(); var value_check = new Dictionary <string, string> { { "token", tokenCheck } }; var content = new FormUrlEncodedContent(value_check); var response = await client.PostAsync("https://trustfundapp.herokuapp.com/m/ensureToken", content); switch (response.StatusCode) { case (System.Net.HttpStatusCode.OK): Application.Current.MainPage = new NavigationPage(new MainPage()); break; case (System.Net.HttpStatusCode.Forbidden): ErrorMsn.IsVisible = true; ErrorMsn.Text = "Porfavor confirma tus datos de sesión"; Cator.IsVisible = false; Cator.IsRunning = false; Username.IsVisible = true; Pass.IsVisible = true; Pass.Focus(); SubmitButton.Text = "Volver a Intentar"; break; } } }
public SignUp() { InitializeComponent(); Title = "WASH DRY"; //PropertyMaximumDate = DateTime.Now; userdb = new UserDataBase(); var user_token = userdb.GetMembers().ToList(); int RowCount = 0; int regcount = user_token.Count(); RowCount = Convert.ToInt32(regcount); var token = user_token[0].token; }
public IActionResult Delete(string email) { var AuxUser = UserDataBase.GetUser(email); if (AuxUser == null) { return(NotFound()); } else if (!UserDataBase.DeleteUser(email)) { return(BadRequest()); } return(Ok()); }
private async Task CancelarServicio(int id) { btnCancel.IsEnabled = false; Cator.IsRunning = true; Cator.IsVisible = true; var msn = Message.Text; if (string.IsNullOrEmpty(msn)) { Message.Focus(); } else { HttpClient client = new HttpClient(); var cancel_values = new Dictionary <string, string> { { "id_solicitud", id.ToString() }, { "comentario", msn.ToString() } }; var cancel_content = new FormUrlEncodedContent(cancel_values); //solicitud/agrega var cancelpost = await client.PostAsync("http://www.washdryapp.com/app/public/solicitud/cliente_cancelar", cancel_content); if (cancelpost.IsSuccessStatusCode) { userDataBase = new UserDataBase(); userDataBase.DeleteSolicitud(id); await DisplayAlert("Lavado cancelado", "Solicitud de servicio cancelada.", "ok"); await PopupNavigation.PopAsync(); } else { HttpContent contentx = cancelpost.Content; var respx = await contentx.ReadAsStringAsync(); await DisplayAlert("Error", "Pudo haber un error. Intente en otro momento . " + respx, "ok"); await PopupNavigation.PopAsync(); } await Navigation.PopToRootAsync(); } Cator.IsRunning = false; Cator.IsVisible = false; }
public static IBridge GetBridge() { //chenge to real when the real instance is ready Proxy proxy = new Proxy(); // IUserDataBase db = new UserDataBase(); UserDataBase db = UserDataBase.Instance; IUserEnforcer uh = new UserEnforcer(); IGameCenter gc = GameCenter.Instance; Real real = new Real(new UserController(uh, db), new GameController(gc)); //chenge to real on connection // proxy.SetRealBridge(real); return(real); }
public ActionResult <User> Get(string email) { try { var AuxUser = UserDataBase.GetUser(email).First(); if (AuxUser == null) { return(BadRequest()); } return(Ok(AuxUser)); } catch (InvalidOperationException) { return(NotFound()); } }
public Admin_sUpdateService(RegistrationDataBase registrationDataBase, UserDataBase userDataBase, FeederDataBase feederDataBase, TagsDataBase tagsDataBase) { this.registrationDataBase = registrationDataBase; this.userDataBase = userDataBase; this.feederDataBase = feederDataBase; this.tagsDataBase = tagsDataBase; checkUpdate = new Thread(CheckUpdate); lastVersionRegistrationQueue = null; lastVersionUsersList = null; lastVersionFeederList = null; lastVersionTagsList = null; selectedFeederId = 0; selectedUserId = 0; checkUpdate.Start(); }
public ActionResult RemoveFromCartCustomer(int id) { using (UserDataBase userContext = new UserDataBase()) { List <CartModel> cart = (List <CartModel>)Session["cart"]; foreach (var item in cart) { if (item.ProductId == id) { cart.Remove(item); break; } } Session["cart"] = cart; } return(RedirectToAction("CustomerProductData")); }
protected override void OnAppearing() { Cator.IsVisible = true; userDataBase = new UserDataBase(); var user_exist = userDataBase.GetMembers().ToList(); if (user_exist.Count() > 0) { _ = GetInfoUser(); } else { lbl1.Text = "Error. No hay info de usuario en SQLite"; Cator.IsVisible = false; } }
public Result Register(UserDataObject userObj) { try { UserDataBase User = new UserDataBase(); Result ResultObj = new Result(); if (Validator.IsValidEmail(userObj.Emailid) == false) { throw new CMSException.FormatException("Not a Valid Email"); } if (Validator.IsValidPhone(userObj.Phone) == false) { throw new CMSException.FormatException("Not a Valid PhoneNumber"); } if (User.Register(userObj) == 1) { ResultObj.Status = "Success"; ResultObj.Message = "Created User Successfully"; } else { ResultObj.Status = "Failure"; ResultObj.Message = "Couldnt Create User"; } return(ResultObj); } catch (Exception e) { if (e.Message.Contains(userObj.Emailid)) { DuplicateEmailException Dupex = new DuplicateEmailException("Email ID already Taken"); throw Dupex; } else if (e.Message.Contains(userObj.Phone.ToString())) { DuplicatePhoneException Dupex = new DuplicatePhoneException("Phone Number already Taken"); throw Dupex; } else { throw e; } } }
void SKillLockProcess() { UserDataBase UDB = GameDataBase.getDBinstance.getUserDB; GameObject dark_lock_button = transform.FindChild("Dark").FindChild("Locked").gameObject; GameObject death_lock_button = transform.FindChild("Death").FindChild("Locked").gameObject; GameObject legend_lock_button = transform.FindChild("Legend").FindChild("Locked").gameObject; /* * int skillLockLevel = PlayerPrefs.GetInt("SkillLock", 000); * dark_lock_button.SetActive((skillLockLevel % 10 == 0)); * death_lock_button.SetActive((skillLockLevel / 10) % 10 == 0); * legend_lock_button.SetActive(skillLockLevel / 100 == 0); */ dark_lock_button.SetActive(!UDB.isSkillOpen('d')); death_lock_button.SetActive(!UDB.isSkillOpen('D')); legend_lock_button.SetActive(!UDB.isSkillOpen('l')); }