public CheckUser(List <SubscriptionUser> p_alList) { InitializeComponent(); SelectUser = null; if (p_alList != null && p_alList.Count > 0) { lbCheckList.DisplayMember = "Description"; lbCheckList.Items.Clear(); foreach (SubscriptionUser gsb in p_alList) { lbCheckList.Items.Add(gsb); } } }
public JsonResult CreateSubscription(string email, string name, string mobile, string remarks) { ApiResponse apiResponse = new ApiResponse(); apiResponse.IsSuccess = true; apiResponse.Message = "Thank you for subscription."; if (string.IsNullOrEmpty(email)) { apiResponse.IsSuccess = false; apiResponse.Message = "Email field is required."; } else { try { var addr = new System.Net.Mail.MailAddress(email); } catch { apiResponse.IsSuccess = false; apiResponse.Message = "Please enter a valid Email Address."; } } if (apiResponse.IsSuccess) { SubscriptionUser model = new SubscriptionUser(); model.Name = name?.Trim(); model.Email = email.Trim(); model.Mobile = mobile?.Trim(); model.Remarks = remarks?.Trim(); _subscriptionUserService.Save(model); } return(Json(apiResponse)); }
private void btnCheck_Click(object sender, EventArgs e) { SelectUser = (SubscriptionUser)lbCheckList.SelectedItem; this.Hide(); }