public async void f_LoadDataDetails(string id) { int merchanId = Convert.ToInt32(id); var response = await MerchantLogic.FetchDetail(new { Id = merchanId }); if (response != null) { txtName.Text = response.MerchantName; txtDiaChi1.Text = response.Address1; txtEmail.Text = response.Email; txtPhone.Text = response.Phone; txtFax.Text = response.Fax; txtTrangThai.Text = response.Status.Trim() == "A" ? "Đang hoạt động" : "Ngừng hoạt động"; txtNgayDuyet.Value = response.ApprovalDate; dtpNgayTG.Value = response.LastActiveDate; txtDC2.Text = response.Address2; txtDC3.Text = response.Address3; txtLoai.Text = response.MerchantType.TypeName; txtQH.Text = response.District.DistrictName; txtTT.Text = response.Province.ProvinceName; txtZip.Text = response.Zip; txtAgentID.Text = response.Agent.AgentId; txtAgentQL.Text = response.Agent.AgentName; } }
private async void LoadDataByView() { try { int _action = Convert.ToInt32(cboViews.SelectedValue.ToString()); int _value = Convert.ToInt32(cboDataView.SelectedValue.ToString()); var obj = new { action = _action, value = _value }; var response = await MerchantLogic.FetchDataByView(obj); if (response != null && response.Rows.Count > 0) { gvKetQua.DataSource = response; } else { MessageBox.Show("Không tìm thấy thông tin !", "Thông báo"); gvKetQua.DataSource = null; } } catch (Exception ex) { return; } }
private async void f_LoadGrid() { try { int type = Convert.ToInt32(cboLoai.SelectedValue.ToString()); var result = await MerchantLogic.FetchManaged(type); foreach (var item in result) { item.Status = item.AgentId.HasValue ? "Đã có quản lý" : "Chưa được quản lý"; } if (result != null && result.Count > 0) { gvKetQua.DataSource = result; } else { gvKetQua.DataSource = null; } } catch (Exception ex) { return; } }
private async void btnSearch_Click(object sender, EventArgs e) { var searchCriteria = new MerchantSearchCriteria() { Id = txtId.Text, Name = txtName.Text, Province = txtProvince.Text, District = txtDistrict.Text, IsActive = checkBox1.Checked }; var merchants = await MerchantLogic.SearchMerchant(searchCriteria); var tableSource = merchants.ToDataTable(); gridMerchant.DataSource = tableSource; }
private async void f_LoadMerchantList() { try { var result = await MerchantLogic.FetchAllMerchant(); cbbMerchantList.DataSource = result; cbbMerchantList.DisplayMember = "MerchantName"; cbbMerchantList.ValueMember = "MerchantID"; cbbMerchantList.SelectedIndex = 0; f_LoadStatusWhenIndexChanged(); } catch (Exception ex) { return; } }
private async void f_LoadStatusWhenIndexChanged() { try { var result = await MerchantLogic.FetchStatusOfMerchant(cbbMerchantList.SelectedValue.ToString()); if (result == true) { lbStatus.Text = "Đang hoạt động"; } else { lbStatus.Text = "Ngưng hoạt động"; } } catch (Exception ex) { return; } }
private async void LoadAllTypeMC() { try { string index = cboViews.SelectedValue.ToString(); var provinces = await MerchantLogic.FetchAllTypeByID(index); cboDataView.DataSource = provinces; cboDataView.DisplayMember = "name"; cboDataView.ValueMember = "id"; if (provinces.Count > 0) { cboDataView.SelectedIndex = 0; } } catch (Exception ex) { return; } }
public int DrawCard() { activeCard = mainDeck.Pop(); switch ((CardType)activeCard) { case CardType.MONSTER: MonsterLogic monsterLogic = new MonsterLogic(); monsterLogic.EncounterRandomMonster(hero.getLevel()); cardLogic = monsterLogic; break; case CardType.POTION: potionLogic.DiscoverPotion(); cardLogic = potionLogic; break; case CardType.ITEM: ItemLogic itemLogic = new ItemLogic(); itemLogic.GenerateItem(hero.getLevel()); cardLogic = itemLogic; break; case CardType.OPAL: cardLogic = new OpalLogic(); break; case CardType.MERCHANT: MerchantLogic merchantLogic = new MerchantLogic(); merchantLogic.GenerateItems(hero.getLevel()); cardLogic = merchantLogic; break; case CardType.BLACKSMITH: BlacksmithLogic blacksmithLogic = new BlacksmithLogic(); blacksmithLogic.SetReforgeableItems(hero); cardLogic = blacksmithLogic; break; case CardType.THIEF: cardLogic = new ThiefLogic(); break; case CardType.WELL: cardLogic = new WellLogic(); break; case CardType.GRAVE: cardLogic = new GraveLogic(); break; case CardType.GAMBLER: cardLogic = new GamblerLogic(); break; case CardType.PASSERBY: cardLogic = new PasserbyLogic(mainDeck); break; case CardType.RESCUED: cardLogic = new RescuedLogic(); break; } cardLogic.ResetStage(); persister.SaveHero(hero); return(activeCard); }