public ActionResult Create(FormCollection collection) { var supporter = new Supporter(); try { this.RadynTryUpdateModel(supporter); supporter.CongressId = this.Homa.Id; HttpPostedFileBase file = null; if (Session["ImageSupporter"] != null) { file = (HttpPostedFileBase)Session["ImageSupporter"]; Session.Remove("ImageSupporter"); } supporter.CurrentUICultureName = collection["LanguageId"]; if (CongressComponent.Instance.BaseInfoComponents.SupporterFacade.Insert(supporter, file)) { ShowMessage(Resources.Common.InsertSuccessMessage, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Succeed); return(this.SubmitRedirect(collection, new { Id = supporter.Id })); } ShowMessage(Resources.Common.ErrorInInsert, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Error); return(Redirect("~/Congress/Supporter/Index")); } catch (Exception exception) { ShowExceptionMessage(exception); return(View()); } }
public async Task <Supporter> SubscriptionAsync(Supporter supporter) { if (supporter == null) { throw new ArgumentNullException(nameof(supporter)); } if (supporter.mailinglist.ToLower() == "false") { logger.LogInformation("Supporter does not want to be added to the Mailing list"); return(supporter); } var id = await InsertSubscriberAsync(supporter?.email); if (id == 0) { logger.LogWarning($"Conflict - {supporter.email}"); return(supporter); } await InsertSubscriber_MetaAsync(id); await InsertSubscriber_FieldsAsync(id, supporter); await InsertLists_SubscribersAsync(id, "Donation Manager"); logger.LogInformation($"Subscriber added - {supporter.email}"); return(supporter); }
// サポーターリストを作成するコード public void InitSupportersList(List <Supporter> pSupportersList) { int count = pSupportersList.Count; for (int i = 0; i < count; i++) { Supporter aSupporter = pSupportersList[i]; var item = Instantiate(prefab) as RectTransform; item.SetParent(transform, false); // Setting Button btn = item.GetComponentInChildren <Button>(); int aId = aSupporter.id; btn.onClick.AddListener(() => { _gameCtrl.purchaseSupporter(aId); }); SupporterPanelCtrl spPanel = item.GetComponent <SupporterPanelCtrl>(); spPanel.init(aSupporter); itemList.Add(spPanel); } }
public void updateSupportersInfo(Supporter pSp) { //for (int i = 0; i < itemList.Count; i++) { // if (itemList[i] //} itemList[pSp.id - 1].setInformation(pSp); }
public ActionResult Create(Supporter supporter) { if (ModelState.IsValid) { supporter.user.userStatus = "sp"; BusinessLayerResult <Supporter> res = supManager.Insert(supporter); if (res.Errors.Count > 0) { res.Errors.ForEach(x => ModelState.AddModelError("", x.Message)); return(View(supporter)); } return(RedirectToAction("Index")); } return(View(supporter)); /* * if (ModelState.IsValid) * { * * responManager.Insert(responsible); * return RedirectToAction("Index"); * } * return View("Index");*/ }
internal async Task <int> InsertSubscriber_FieldsAsync(int id, Supporter supporter) { foreach (PropertyInfo pi in supporter.GetType().GetProperties()) { using (var cmd = _mySqlDatabase.Connection.CreateCommand()) { var key = pi.Name; var value = pi.GetValue(supporter, null); cmd.CommandText = @$ "INSERT INTO swimtayk_{suffix}.{prefix}mailster_subscriber_fields (subscriber_id, meta_key, meta_value) VALUES (@id, @key, @value);"; cmd.Parameters.AddWithValue("@id", id); cmd.Parameters.AddWithValue("@key", key); cmd.Parameters.AddWithValue("@value", value); if (value != null) { await cmd.ExecuteNonQueryAsync(); } else { logger.LogWarning($"the subscriber - {id}, key:{key} does not have a value so not recorded"); } } } return(id); }
public async Task <IActionResult> Put(int id, Supporter supporter) { if (id != supporter.Id) { return(BadRequest()); } _context.Entry(supporter).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Exists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Supporter> > Post(Supporter supporter) { _context.Supporters.Add(supporter); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSupporter", new { id = supporter.Id }, supporter)); }
protected void btnIsApproval_Click1(object sender, EventArgs e) { CankayaFootballLeagueEntities _db = new CankayaFootballLeagueEntities(); for (int i = 0; i < grvSupporterList.Rows.Count; i++) { GridViewRow row = (GridViewRow)grvSupporterList.Rows[i]; CheckBox c = (CheckBox)row.FindControl("cbIsApproval"); Label lblId = (Label)row.FindControl("lblId"); int idd = Convert.ToInt32(lblId.Text); if (c.Checked == true) { Supporter sup1 = (from x in _db.Supporters where x.isActive == true && x.isApproval == false && x.SupporterId == idd select x).SingleOrDefault(); sup1.isApproval = true; } } _db.SaveChanges(); List <Supporter> sup = (from x in _db.Supporters where x.isActive == true && x.isApproval == false select x).ToList(); grvSupporterList.DataSource = sup.OrderBy(i => i.Name); grvSupporterList.DataBind(); for (int i = 0; i < grvSupporterList.Rows.Count; i++) { GridViewRow row = (GridViewRow)grvSupporterList.Rows[i]; Label lblNumber = (Label)row.FindControl("lblNumber"); lblNumber.Text = (i + 1).ToString(); } }
public IActionResult Edit([FromBody] SupporterDto supporter, int id) { var editedSupporter = new Supporter { EmployeeId = id, Name = supporter.Name, Title = supporter.Title, ManagerId = supporter.ManagerId }; var editSupporter = new SupporterModifier(_repo).EditEmployee(editedSupporter); switch (editSupporter) { case StatusCodes.Success: return(StatusCode((int)HttpStatusCode.OK, $"{editedSupporter.Name} has been updated!")); case StatusCodes.NotFound: return(StatusCode((int)HttpStatusCode.NotFound, "Sorry, it does not look like that person exists.")); case StatusCodes.Unsuccessful: return(StatusCode((int)HttpStatusCode.InternalServerError, "Sorry, something went wrong. Please try again later.")); default: return(StatusCode((int)HttpStatusCode.InternalServerError, "Sorry, something went wrong. Please try again later.")); } }
public Supporter GetToAuthenticate(string email, string password) { Supporter supporter = null; using (var client = new HttpClient()) { client.BaseAddress = new Uri("https://localhost:44385/api/supporter/"); try { var responseTask = client.GetAsync("GetToAuthenticate?email=" + email + "&password=" + password); responseTask.Wait(); var result = responseTask.Result; if (result.IsSuccessStatusCode) { var readTask = result.Content.ReadAsAsync <Supporter>(); readTask.Wait(); supporter = readTask.Result; } } catch (AggregateException agg_ex) { var ex = agg_ex.InnerExceptions[0]; } } return(supporter); }
public async Task <int> Add(Supporter supporter) { var request = await _dbContext.Supporters.AddAsync(supporter); await _dbContext.SaveChangesAsync(); return(request.Entity.Id); }
public ActionResult DeleteConfirmed(int id) { Supporter supporter = db.Supporters.Find(id); db.Supporters.Remove(supporter); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(int id) { Supporter supporter = supManager.Find(x => x.Id == id); supManager.Delete(supporter); return(RedirectToAction("Index")); }
void Start() { spawnStart = true; JewelList = new GameObject[7, 9]; posX = new int[7]; QuaX = new int[7]; sp = new Supporter(); }
public IActionResult Index(Supporter supporter) { if (GetToAuthenticate(supporter.Email, supporter.Password) != null) { HttpContext.Session.SetString("email", supporter.Email); } return(RedirectToAction("Index", "Home")); }
public ActionResult Create() { Supporter sup = supManager.List().OrderByDescending(x => x.Id).FirstOrDefault(); if (sup == null) { return(HttpNotFound()); } return(View(sup)); }
void Start() { #if UNITY_IPHONE Application.targetFrameRate = 60; #endif sp = new Supporter(); Editor.down = false; supportTimeRp = 5f; }
public ActionResult Edit([Bind(Include = "SupporterId,FullName,Email,SupporterAddress")] Supporter supporter) { if (ModelState.IsValid) { db.Entry(supporter).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SupporterAddress = new SelectList(db.Addresses, "AddressId", "ContactPerson", supporter.SupporterAddress); return(View(supporter)); }
public Supporter isSupporterFound(string email, string password) { CankayaFootballLeagueEntities _db = new CankayaFootballLeagueEntities(); Supporter s = (from x in _db.Supporters where x.Email == email && x.isActive == true select x).SingleOrDefault(); if (VerifyPassword(password, s.Password) == true) { return(s); } return(null); }
public void Start() { Room kitchen = new Room("The Kitchen"); kitchen.description = @"I'm in the kitchen now. [if the lockdown is true] A pleasant yet urgent announcement rings '[b]Laserite Core criticality event detected: apartment lockdown in effect.[/b]' The doors leading to other parts of the apartment are shielded with comically elaborate folding door layers.[end if] [if unvisited]The refrigerator remains unmentioned.[end if] A [table] obnoxiously takes up most of the useful room in here."; Room yourRoom = new Room("Your Room"); yourRoom.description = @"I'm in your room [if unvisited]now.[otherwise]again.[end if] What do you want me to do in here? You obviously know what's in your room, but just in case[one of] you have amnesia[or] you're standing on a rug that erases all memory of your existence outside the rug[or] a cougar ate your memory of being attacked by a cougar[or] i'm talking to a stranger who stole your phone[at random]: You've got your desk with wires growing out of it. There are some seltzer bottles strewn on the floor. It's kind of a mess in here tbh."; kitchen.connections.Add((Direction.West, yourRoom)); Thing cellphone = new Thing("The cellphone"); cellphone.description = "It's my fancy new iPhone LXVMMMMCDXX - and the object that i'm currently using to text you. In airplane mode, it hovers at a convenient distance to provide a truly hands-free experience."; cellphone.aliases.Add("phone"); cellphone.aliases.Add("iphone LXVMMMMCDXX/--"); kitchen.things.Add(cellphone); Supporter kitchenTable = new Supporter("The kitchen table"); kitchen.things.Add(kitchenTable); kitchenTable.description = "An unlikely place to put anything useful."; Potato potato = new Potato("a potato"); Thing lomato = new Thing("a lomato?"); Thing chonkChart = new Thing("The chonk chart"); chonkChart.description = @"A small holocard with a gaudy label that says '[b]Now That's What I Call Chonk! Vol. 1[/b]' I think I can use this with the Chonkédex app on my [cellphone]."; kitchenTable.things.Add(chonkChart); Instead(taking).Condition((Thing noun) => (noun.edible || noun.portable) && (noun.lit || noun.scenery)).Do(() => { Say("I lean over the [chart], but my[cellphone] zips in and absorbs the holocard before i can chow down."); lockdown = false; lomato.location = yourRoom; potato.wet = true; }); }
// GET: Supporters/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Supporter supporter = db.Supporters.Find(id); if (supporter == null) { return(HttpNotFound()); } return(View(supporter)); }
public void init(Supporter pSupporter) { setTexts(pSupporter); // 画像を当てる for (int j = 0; j < this.transform.childCount; j++) { if (this.transform.GetChild(j).name == "Image") { Image img = this.transform.GetChild(j).GetComponent <Image>(); img.sprite = pSupporter.image; } } }
// GET: Supporters/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Supporter supporter = db.Supporters.Find(id); if (supporter == null) { return(HttpNotFound()); } ViewBag.SupporterAddress = new SelectList(db.Addresses, "AddressId", "ContactPerson", supporter.SupporterAddress); return(View(supporter)); }
public ActionResult create([FromBody] Supporter supporter) { using (var client = new HttpClient()) { client.BaseAddress = new Uri("https://localhost:44385/api/supporter/"); var postTask = client.PostAsJsonAsync <Supporter>("Post", supporter); postTask.Wait(); var result = postTask.Result; if (result.IsSuccessStatusCode) { return(RedirectToAction("Index")); } } ModelState.AddModelError(string.Empty, "Error, Contacta con el administrador"); return(View(supporter)); }
public IActionResult Add([FromBody] SupporterDto supporter) { var newSupporter = new Supporter { Name = supporter.Name, Title = supporter.Title, ManagerId = supporter.ManagerId }; var addSupporter = _repo.AddSupporter(newSupporter); return(addSupporter ? StatusCode((int)HttpStatusCode.Created, "Your new supporter has been added!") : StatusCode((int)HttpStatusCode.InternalServerError, "Sorry, something went wrong. Please try again later.")); }
void Start() { SpawnEnemy(4); dealer = Dealer.GetComponent <Dealer>(); healer = Healer.GetComponent <Healer>(); dealTank = DealTank.GetComponent <DealTank>(); tanker = Tanker.GetComponent <Tanker>(); supporter = Supporter.GetComponent <Supporter>(); allies.Add(dealer); allies.Add(healer); allies.Add(dealTank); allies.Add(tanker); allies.Add(supporter); //SpawnAOEDamage(2, 1, 2, 10000); }
public ActionResult Edit(Supporter supporter) { if (ModelState.IsValid) { BusinessLayerResult <Supporter> res = supManager.Update(supporter); if (res.Errors.Count > 0) { res.Errors.ForEach(x => ModelState.AddModelError("", x.Message)); return(View(supporter)); } return(RedirectToAction("Index")); } return(View(supporter)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Supporter responsible = supManager.Find(x => x.Id == id.Value); if (responsible == null) { return(HttpNotFound()); } return(View(responsible)); }
// idとレベルから、ppa、next_level_coinを算出し、supporterクラスを生成 Supporter getSupporterClass(int pId, int pLevel) { Supporter sp = new Supporter(); string name = _supporterMasterList [pId - 1].name; float basePpa = _supporterMasterList [pId - 1].base_ppa; float atkInt = _supporterMasterList [pId - 1].atk_interval; int baseCoin = _supporterMasterList [pId - 1].base_coin; string imagePath = "images/supporters/" + _supporterMasterList [pId - 1].image_path; Sprite image = Resources.Load <Sprite>(imagePath) as Sprite; if (image != null) { Debug.Log("imagePath: " + imagePath + " successfully loaded! " + image); } string growthType = _supporterLevelMasterList [pId - 1].growth_type; float multipleRatePpa = 1; float multipleRateCoin = 1; if (pLevel >= 1) { for (int i = 0; i < _supporterLevelMasterList.Count; i++) { if (_supporterLevelMasterList [i].growth_type == growthType && _supporterLevelMasterList [i].level == pLevel) { multipleRatePpa = _supporterLevelMasterList [i].multiple_rate_ppa; multipleRateCoin = _supporterLevelMasterList [i].multiple_rate_coin; } } } sp.id = pId; sp.level = pLevel; sp.name = name; sp.pointPerAttack = basePpa * multipleRatePpa; sp.attackInterval = atkInt; sp.pointPerSecond = sp.getPps(sp.attackInterval, sp.pointPerAttack); sp.nextLevelCoin = Mathf.FloorToInt((float)baseCoin * multipleRateCoin); sp.image = image; return(sp); }
void Awake() { sp = this; }
public Supporter Create(Supporter sp){ sp.Status = EntityStatuses.Actived.ToString(); this.Supporters.InsertOnSubmit(sp); Commit(); return sp; }
public Supporter Add(Supporter sp) { Supporters.InsertOnSubmit(sp); Commit(); return sp; }