public void TestInstanceGetStringValue() { StringEnum stringEnum = new StringEnum(typeof(EnumWithStrings)); Assert.AreEqual("Fourth Value", stringEnum.GetStringValue("Lazy")); //Expect null as this value doesn't exist Assert.IsNull(stringEnum.GetStringValue("clearly not there")); }
private void Control_Init() { #region Set Default Setting rbtn_DisplayResult.SelectedValue = "True"; tbx_SuccessfulURL.Text = "/"; RadEditor_SuccessfulText.Content = "<H1>Successfully registered!</H1>"; // Load Usergroup list List <Security.Users.UserGroups> myUserGroups = Security.Users.UserMgr.sGet_Usergroups(); droplist_UserGroup.DataSource = myUserGroups; droplist_UserGroup.DataTextField = "UserGroup_Name"; droplist_UserGroup.DataValueField = "UserGroupID"; droplist_UserGroup.DataBind(); droplist_UserGroup.SelectedValue = StringEnum.GetStringValue(Security.Users.UserGroup.RegisteredUser); #endregion if (!DataEval.IsEmptyQuery(_createuserid)) { #region Login Properties rbtn_DisplayResult.SelectedValue = _displayresult.ToString(); tbx_SuccessfulURL.Text = _successfulurl; RadEditor_SuccessfulText.Content = _successfultext; droplist_UserGroup.SelectedValue = _usergroupid; #endregion } }
private void Control_PreInit() { RadTabStrip_Commands.Visible = false; #region Bind ImageURL Types //Gets your enum names and adds it to a string array Array enumNames = Enum.GetValues(typeof(Lib.ImageURL_Type)); //Creates an ArrayList ArrayList myImageURL_Types = new ArrayList(); //Loop through your string array and poppulates the ArrayList foreach (Lib.ImageURL_Type myImageURL_Type in enumNames) { myImageURL_Types.Add(new { Value = StringEnum.GetStringValue(myImageURL_Type), Name = StringEnum.GetStringValue(myImageURL_Type) }); } //Bind the ArrayList to your DropDownList droplist_ImageType.DataSource = myImageURL_Types; droplist_ImageType.DataTextField = "Name"; droplist_ImageType.DataValueField = "Value"; droplist_ImageType.DataBind(); #endregion }
private void Control_Init() { if (DataEval.IsEmptyQuery(_scriptid)) { MultiView_Content.SetActiveView(View_New); } else { MultiView_Content.SetActiveView(View_Show); if (_isshared) { Lib.ScriptMgr myScriptMgr = new Lib.ScriptMgr(); Lib.Script myScript = myScriptMgr.Get_Script_Content(_contentid); _script_type = StringEnum.GetStringValue(myScript.Script_Type); _script_content = myScript.Script_Content; } string myCodeBlock_Script = ""; myCodeBlock_Script = "<script type=" + DataEval.QuoteText(_script_type) + " >" + "\n" + _script_content + "\n" + "</script>" + "\n"; Literal_TextContent.Text = string.Format("<Pre>{0}</Pre>", Server.HtmlEncode(myCodeBlock_Script)); } }
private void Control_FillData() { #region Create Variant //Gets your enum names and adds it to a string array Array enumNames = Enum.GetValues(typeof(Variant_Type)); //Creates an ArrayList ArrayList myVariantTypes = new ArrayList(); //Loop through your string array and poppulates the ArrayList foreach (Variant_Type myVariant_Type in enumNames) { myVariantTypes.Add(new { Value = StringEnum.GetStringValue(myVariant_Type), Name = StringEnum.GetStringValue(myVariant_Type) }); } //Bind the ArrayList to your DropDownList droplist_Variant_Type.DataSource = myVariantTypes; droplist_Variant_Type.DataTextField = "Name"; droplist_Variant_Type.DataValueField = "Value"; droplist_Variant_Type.DataBind(); // Set Default value droplist_Variant_Type.SelectedIndex = 0; tbx_Variant_Name.Text = ""; tbx_Table_Name.Text = ""; #endregion }
/// <summary>Returns a string that represents the current object.</summary> /// <returns>A string that represents the current object.</returns> public override string ToString() { var oldString = $"Pacification Type: {StringEnum.GetStringValue(this.PacificationType)}@Required DeltaV: {this.RequiredDeltaV}"; var newString = oldString.Replace("@", "\n"); return(newString); }
/// <summary> /// 원화충전 리스트 /// </summary> public async void GetKrwRecharge(EnumLib.PaymentWay SelectCode) { try { Messenger.Default.Send("AssetsRefresh"); using (RequestKrwRechargeModel req = new RequestKrwRechargeModel()) { req.userEmail = MainViewModel.LoginDataModel.userEmail; req.payKndCd = StringEnum.GetStringValue(SelectCode); using (ResponseKrwRechargeModel res = await WebApiLib.AsyncCall <ResponseKrwRechargeModel, RequestKrwRechargeModel>(req)) { if (SelectCode.Equals(EnumLib.PaymentWay.accountTransfer)) { KrwRechargeList = res.data.list; } else if (SelectCode.Equals(EnumLib.PaymentWay.prepaidCard)) { for (int i = 0; i < res.data.list.Count; i++) { res.data.list[i].cardNum = CommonLib.CardNumChange(res.data.list[i].cardNum); } CardRechargeList = res.data.list; } } } } catch (Exception ex) { SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace); } }
public async void CmdDelete(string contentId) { try { Alert alert = new Alert(Localization.Resource.Common_Alert_14, Alert.ButtonType.YesNo); if (alert.ShowDialog() == true) { using (RequestBoardDeleteModel req = new RequestBoardDeleteModel()) { req.boardId = StringEnum.GetStringValue(EnumLib.BoardCode.Qna); req.contentId = contentId; using (ResponseBoardDeleteModel res = await WebApiLib.AsyncCall <ResponseBoardDeleteModel, RequestBoardDeleteModel>(req)) { alert = new Alert(Localization.Resource.Common_Alert_15); alert.ShowDialog(); GetData(); } } } } catch (Exception ex) { SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace); } }
public void UrlCall(Dictionary <string, EnumLib.ExchangeCurrencyCode> Temp, bool resize = false) { try { this.Dispatcher.BeginInvoke(new Action(() => { if (string.IsNullOrWhiteSpace(StringEnum.GetStringValue(Temp.Values.First()))) { return; } CoinType = Temp; int height = web.Height; int width = web.Width; //string marketNm = Temp.Keys.First().ToString(); //string marketCd = StringEnum.GetStringValue((EnumLib.ExchangeCurrencyCode)Enum.Parse(typeof(EnumLib.ExchangeCurrencyCode), marketNm)); string marketCd = Temp.Keys.First().ToString(); string Url = ConfigLib.WebUrl + "bt.chartInit.dp/proc.go?headViewYn=N&coinInfo=" + StringEnum.GetStringValue(Temp.Values.First()) + "&height=" + height + "px&width=" + width + "px&marketCd=" + marketCd; web.Navigate(Url); })); } catch (Exception ex) { SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace); } }
public static ListItemCollection BuildListFromEnum(Enum objEnum) { ListItemCollection colListItems = new ListItemCollection(); ListItem liItem; SortedList colSortedListItems = new SortedList(); foreach (int value in Enum.GetValues(objEnum.GetType())) { liItem = new ListItem(); liItem.Value = value.ToString(); liItem.Text = StringEnum.GetStringValue((Enum)Enum.Parse(objEnum.GetType(), value.ToString(), true)); if (liItem.Text != string.Empty) { colSortedListItems.Add(liItem.Text, liItem); } liItem = null; } foreach (ListItem liListItem in colSortedListItems.GetValueList()) { colListItems.Add(liListItem); } return(colListItems); }
/// <summary> /// Notifies the event. /// </summary> /// <param name="url">The URL.</param> /// <param name="action">The action.</param> /// <returns></returns> public static EventResponse NotifyEvent(string url, EventAction action) { try { if (log.IsDebugEnabled) { log.Debug(string.Format("Sending event [{0}]", action.Notification)); } EventInvocation invoker = Activator.GetObject(typeof(EventInvocation), url) as EventInvocation; EventResponse response = invoker.Invoke(action); if (log.IsDebugEnabled) { log.Debug("Event is successfully sent"); } return(response); } catch (Exception ex) { log.Error(string.Format("Invocation error: {0}", ex.Message), ex); } EventResponse defaultResponse = new EventResponse(); defaultResponse.Status = StringEnum.GetStringValue(EventNotificationResponse.Failed); return(defaultResponse); }
/// <summary> /// Handles the Click event of the btnStart control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void btnStart_Click(object sender, EventArgs e) { try { // Perform validation if (!FormHelper.ValidateNotEmpty(txtPath, Resources.MsgWebServerPathRequired)) { return; } if (!FormHelper.ValidateNotEmpty(txtVirtualPath, Resources.MsgWebServerVirtualPathRequired)) { return; } if (!FormHelper.ValidateGreaterThanZero(txtPort, Resources.MsgWebServerPortRequired)) { return; } // Save the existing setting to database AppConfigSettings.Update(ConfigParameter.WebServerAppPath, txtPath.Text); AppConfigSettings.Update(ConfigParameter.WebServerVirtualPath, txtVirtualPath.Text); AppConfigSettings.Update(ConfigParameter.WebServerPort, txtPort.Text); AppConfigSettings.Update(ConfigParameter.WebServerAutoStart, Convert.ToString(chkAutoStart.Checked)); EventAction action = new EventAction(StringEnum.GetStringValue(EventNotificationType.StartWebServer)); EventResponse response = RemotingHelper.NotifyEvent(ServiceEventListenerUrl, action); txtStatus.Text = StringEnum.GetStringValue(WebServerStatus.Starting); } catch (Exception ex) { FormHelper.ShowError(ex.Message); } }
public p_participation_000086(CDAParticipationType thisTypeCode) : base() { functionTypeSet = false; base.typeCode = StringEnum.GetStringValue(thisTypeCode); base.contextControlCode = "OP"; }
private object VisitQuestion(Question question) { if (question.IsComputed) { DataType expressionType = question.Expression.GetType(_symbolTable); if (expressionType != DataType.Undefined) { if (question.DataType != expressionType) { Report.AddError(question.Position, "Cannot assign a value of type '{0}' to question '{1}' of type '{2}'.", StringEnum.GetStringValue(expressionType), question.Id.Name, StringEnum.GetStringValue(question.DataType)); } } question.Expression.Accept(this); } // Check when the question is redeclared, it is of the same type. if (_symbolTable.ContainsKey(question.Id.Name)) { if (question.DataType != _symbolTable[question.Id.Name]) { Report.AddError(question.Position, "Cannot redeclare a question with a different type."); } } _symbolTable.Add(question.Id.Name, question.DataType); return(null); }
private void Control_FillData() { string Product_VariantID = Request["Product_VariantID"]; bool variantFound = false; if (!DataEval.IsEmptyQuery(Product_VariantID)) { ProductVariantMgr myProductVariantMgr = new ProductVariantMgr(); if (myProductVariantMgr.Chk_Product_Variant(Product_VariantID)) { Variant myVariant = myProductVariantMgr.Get_Product_Variant(Product_VariantID); lbl_Variant_Name.Text = myVariant.Variant_Name; tbx_Variant_Name.Text = myVariant.Variant_Name; lbl_Variant_Type.Text = StringEnum.GetStringValue(myVariant.Variant_Type); tbx_Table_Name.Text = myVariant.Table_Name; // Spliter tbx_Spliter_Name.Text = ""; variantFound = true; } } if (!variantFound) { Response.Redirect("Default.aspx"); } }
/// <summary> /// Handles the Click event of the startChannelToolStripMenuItem control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void startChannelToolStripMenuItem_Click(object sender, EventArgs e) { try { ChannelStatusView channel = lvwChannelStatus.SelectedObject as ChannelStatusView; if (channel != null) { EventAction action = new EventAction(StringEnum.GetStringValue(EventNotificationType.StartGateway)); action.Values.Add(EventParameter.GatewayId, channel.Name); EventResponse response = RemotingHelper.NotifyEvent(ServiceEventListenerUrl, action); channel.Status = StringEnum.GetStringValue(GatewayStatus.Starting); lvwChannelStatus.RefreshObject(channel); //lvwChannelStatus.RefreshSelectedObjects(); //FormHelper.ShowInfo(Resources.MsgGatewayStarting); } else { FormHelper.ShowInfo(Resources.MsgNoChannelSelected); } } catch (Exception ex) { FormHelper.ShowError(ex.Message); } }
public void PlayHand(CardData[] cardDatas, HandType handType, int remainingCards, bool playingSet) { passTurnAmount = 0; currentWinningPlayer = currentTurnPlayer; if (playingSet) //if this player played a set { if (previousPlayer != null && previousPlayer != currentTurnPlayer) //if previous 5 cards played by previous player is beaten by this player { previousPlayer.RpcSetEmotion(Character.Emotion.Sad); } else { currentTurnPlayer.RpcSetEmotion(Character.Emotion.Happy); } } ServerUpdatePlayedHand(cardDatas, handType); //if not game over if (remainingCards > 0) { previousPlayer = currentTurnPlayer; ServerNextPlayer(); } else { //end game ServerNextState(StringEnum.GetStringValue(GameState.GameOver)); } }
private void Init_Form() { #region Default setting //Gets your enum names and adds it to a string array Array enumNames = Enum.GetValues(typeof(Lib.Script_Type)); //Creates an ArrayList ArrayList myScriptTypes = new ArrayList(); //Loop through your string array and poppulates the ArrayList foreach (Lib.Script_Type myScriptType in enumNames) { myScriptTypes.Add(new { Value = StringEnum.GetStringValue(myScriptType), Name = myScriptType.ToString() }); } //Bind the ArrayList to your DropDownList droplist_Script_Type.DataSource = myScriptTypes; droplist_Script_Type.DataTextField = "Name"; droplist_Script_Type.DataValueField = "Value"; droplist_Script_Type.DataBind(); tbx_TextContent.Text = ""; #endregion }
public static string OTPCharacters(OTPSettings oTPSettings) { string NewCharacters = string.Empty; string allowedChars = StringEnum.GetStringValue(oTPSettings.OTPCodeType); if (oTPSettings.OTPLength > 0 && string.IsNullOrEmpty(allowedChars)) { char[] sep = { ',' }; string[] arr = allowedChars.Split(sep); string IDString = string.Empty; string temp = string.Empty; //utilize the "random" class Random rand = new Random(); for (int i = 0; i < Convert.ToInt32(oTPSettings.OTPLength); i++) { temp = arr[rand.Next(0, arr.Length)]; IDString += temp; NewCharacters = IDString; } } return(NewCharacters); }
/// <summary> /// Sends the request /// </summary> /// <param name="session">Blg Session</param> private void sendRefDataRequest(Session session) { Service refDataService = session.GetService("//blp/refdata"); Request request = refDataService.CreateRequest(StringEnum.GetStringValue(options.reqType)); if (options.reqType == BlgRequests.historical) { request.Set(StringEnum.GetStringValue(options.periods.Key), StringEnum.GetStringValue(options.periods.Value)); } foreach (KeyValuePair <BlgMiscOpt, dynamic> kvp in options.options) { request.Set(StringEnum.GetStringValue(kvp.Key), kvp.Value); } // Add securities to request Element securities = request.GetElement(SECURITIES); foreach (string s in options.tickers) { securities.AppendValue(s); } // Add fields to request Element fields = request.GetElement(FIELDS); foreach (string s in options.fields) { fields.AppendValue(s); } System.Console.WriteLine("Sending Request: " + request); session.SendRequest(request, null); }
public static WindowsType GetWindowsType() { WindowsType type = WindowsType.Unknown; string query = "SELECT * FROM Win32_OperatingSystem"; using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(query)) { foreach (WindowsType item in Enum.GetValues(typeof(WindowsType))) { foreach (ManagementObject info in searcher.Get()) { if (info.Properties["Caption"].Value.ToString().Contains(StringEnum.GetStringValue(item))) { type = item; break; } /*Console.WriteLine("caption : {0}, version : {1}, sp major : {2}, sp minor : {3}", info.Properties["Caption"].Value.ToString().Trim() * , info.Properties["Version"].Value.ToString() * , info.Properties["ServicePackMajorVersion"].Value.ToString() * , info.Properties["ServicePackMinorVersion"].Value.ToString());*/ } } } return(type); }
public void RowClick() { try { if (MainViewModel.ecd == null || MainViewModel.ecd.IsLoaded == false) { MainViewModel.ecd = new Views.Dashboard.ExchangeChartDashboard(StringEnum.GetStringValue(SelectCoinCode), PriceType, PriceCode); //ecd.WindowStyle = WindowStyle.ToolWindow; MainViewModel.ecd.WindowStyle = WindowStyle.SingleBorderWindow; MainViewModel.ecd.WindowStartupLocation = WindowStartupLocation.CenterScreen; MainViewModel.ecd.Width = 1400; MainViewModel.ecd.Height = 800; MainViewModel.ecd.Title = Localization.Resource.ExchangeChartDashboard_1 + "(" + PriceType + " Market)"; MainViewModel.ecd.Show(); } else { MainViewModel.ecd.Show(); MainViewModel.ecd.Activate(); if (MainViewModel.ecd.WindowState == WindowState.Minimized) { MainViewModel.ecd.WindowState = WindowState.Normal; } } } catch (Exception ex) { SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace); } }
public TLVList getList() { TLVList list = new TLVList(); if (_condition != null) { list.addElement(0, AMQPWrapper <AMQPSymbol> .wrap(new AMQPSymbol(StringEnum.GetStringValue(_condition)))); } if (_description != null) { list.addElement(1, AMQPWrapper <AMQPSymbol> .wrap(_description)); } if (_info != null) { list.addElement(2, AMQPWrapper <AMQPSymbol> .wrapMap(_info)); } DescribedConstructor constructor = new DescribedConstructor(list.Code, new TLVFixed(AMQPType.SMALL_ULONG, new byte[] { 0x1D })); list.Constructor = constructor; return(list); }
public ProjectSearchModel PrepareProjectSearchModel(ProjectSearchModel searchModel) { searchModel.AvailableFaculties.Add(new SelectListItem { Text = "--หน่วยงานหลัก--", Value = "", Selected = true }); searchModel.AvailableFiscalYears.Add(new SelectListItem { Text = "--ปีงบประมาณ--", Value = "", Selected = true }); searchModel.AvailablePageSizes = "10"; searchModel.AvailableResearchStatuses.Add(new SelectListItem { Text = "--สถานะโครงการวิจัย--", Value = "", Selected = true }); searchModel.AvailableProjectStatuses.Add(new SelectListItem { Text = "--สถานะโครงการ--", Value = "", Selected = true }); var projectStatusOptionsIds = System.Enum.GetValues(typeof(ProjectStatus)).Cast <int>().ToList(); foreach (var value in projectStatusOptionsIds) { searchModel.AvailableProjectStatuses.Add(new SelectListItem { Text = StringEnum.GetStringValue((ProjectStatus)value), Value = value.ToString() }); } return(searchModel); }
public void Start() { running = true; laserParentTag = StringEnum.GetStringValue(SpaceWarriorTag.PlayerLasersParent); laserParent = GameObject.FindGameObjectWithTag(laserParentTag).transform; routineRunner.StartCoroutine(spawn()); }
/// <summary> /// Updates the message status. /// </summary> /// <param name="status">The message status.</param> /// <returns></returns> public static bool UpdateStatus(IMessage message, MessageStatus status) { try { // Update message status in database OutgoingMessage outgoingMessage = OutgoingMessage.SingleOrDefault(msg => msg.Id == message.Identifier); if (outgoingMessage == null) { return(false); } outgoingMessage.Status = StringEnum.GetStringValue(status); outgoingMessage.LastUpdate = DateTime.Now; if (status == MessageStatus.Sent) { outgoingMessage.SentDate = outgoingMessage.LastUpdate; } outgoingMessage.Update(); } catch (Exception ex) { log.Error(string.Format("Error updating message: {0} ", ex.Message), ex); return(false); } return(true); }
public async void SearchSellWait(int Count) { try { IsBusy = true; using (RequestTradeHistoryTradingSearchWaitModel req = new RequestTradeHistoryTradingSearchWaitModel()) { req.curcyCd = StringEnum.GetStringValue(Excucode); req.tradeCd = StringEnum.GetStringValue(EnumLib.UnsettledDivisionCode.sellWait); req.mkState = PriceType; req.listSize = Count; using (ResponseTradeHistoryTradingSearchWaitModel res = await WebApiLib.AsyncCall <ResponseTradeHistoryTradingSearchWaitModel, RequestTradeHistoryTradingSearchWaitModel>(req)) { sellWait = res.data.list; sellTime = CommonLib.GetTime; } } IsBusy = false; } catch (Exception ex) { SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace); IsBusy = false; } }
protected void lbtn_Add_Post_Click(object sender, EventArgs e) { _view_stage = "view_add_post"; ViewState["ViewStage"] = _view_stage; MultiView_BlogPosts.SetActiveView(View_Add_Post); #region Initiate Post form default setting tbx_Title.Text = ""; RadEditor_BlogContent.Content = ""; RadEditor_BlogContent.ToolsFile = "~/App_Data/Editor/BasicTools.xml"; //Gets your enum names and adds it to a string array Array enumNames = Enum.GetValues(typeof(Lib.Post_Status)); //Creates an ArrayList ArrayList myPost_Statuses = new ArrayList(); //Loop through your string array and poppulates the ArrayList foreach (Lib.Post_Status myPost_Status in enumNames) { myPost_Statuses.Add(new { Value = StringEnum.GetStringValue(myPost_Status), Name = myPost_Status.ToString() }); } //Bind the ArrayList to your DropDownList droplist_PostStatus.DataSource = myPost_Statuses; droplist_PostStatus.DataTextField = "Name"; droplist_PostStatus.DataValueField = "Value"; droplist_PostStatus.DataBind(); RadDateTimePicker_PostDate.SelectedDate = DateTime.Now; #endregion }
private void Control_Init() { #region Set Default Setting #region Bind Data to droplist // Enable user edit mode //Gets your enum names and adds it to a string array Array enumNames = Enum.GetValues(typeof(Lib.Ebay_ListType)); //Creates an ArrayList ArrayList myEbay_ListType = new ArrayList(); //Loop through your string array and poppulates the ArrayList foreach (Lib.Ebay_ListType myListType in enumNames) { myEbay_ListType.Add(new { Value = StringEnum.GetStringValue(myListType), Name = myListType.ToString() }); } //Bind the ArrayList to your DropDownList droplist_ListType.DataSource = myEbay_ListType; droplist_ListType.DataTextField = "Name"; droplist_ListType.DataValueField = "Value"; droplist_ListType.DataBind(); #endregion CategoryTree_Menu.UnSelectItems(); droplist_ListType.SelectedIndex = 0; tbx_EbayDetailURL.Text = "/"; droplist_SortOrder.SelectedIndex = 0; droplist_Orientation.SelectedIndex = 0; rbtn_ItemTemplate.SelectedValue = "Default"; tbx_ItemTemplateURL.Text = ""; RadNumericTbx_RepeatColumn.Value = 3; rbtn_Enable_Pager.SelectedValue = "True"; RadNumericTbx_NumPerPage.Value = 12; RadNumericTbx_TotalNumber.Value = 100; #endregion if (!DataEval.IsEmptyQuery(_ebay_itemlistid)) { #region Item Properties CategoryTree_Menu.Checked_CategoryID = _categoryid; droplist_ListType.SelectedValue = _ebay_listtype; tbx_EbayDetailURL.Text = _ebay_itemdetailurl; droplist_SortOrder.SelectedValue = _sortorder; droplist_Orientation.SelectedValue = _orientation; rbtn_ItemTemplate.SelectedValue = _itemtemplate; tbx_ItemTemplateURL.Text = _itemtemplateurl; RadNumericTbx_RepeatColumn.Value = _repeatcolumn; rbtn_Enable_Pager.SelectedValue = _enable_pager.ToString(); RadNumericTbx_NumPerPage.Value = _numberperpage; RadNumericTbx_TotalNumber.Value = _totalnumber; #endregion } }
public async void SearchContent() { try { using (RequestSelectBoardDetailModel req = new RequestSelectBoardDetailModel()) { req.boardId = StringEnum.GetStringValue(EnumLib.BoardCode.Qna); req.contentId = sContentId; using (ResponseSelectBoardDetailModel res = await WebApiLib.AsyncCall <ResponseSelectBoardDetailModel, RequestSelectBoardDetailModel>(req)) { if (res.resultStrCode == "000") { ResponseSelectBoardDetailDataModel item = res.data; CommonCombobox selectItem = cbxData.Where(x => x.Value == res.data.catId).FirstOrDefault(); if (selectItem != null) { SelectedCbx = selectItem; } else { SelectedCbx = cbxData[0]; } sTitle = item.boardTitle; sContent = item.contentMsg; sPhoneNumber = item.userPhone; } } } } catch (Exception ex) { SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace); } }