public ActionResult NotaDebitoEmail2(NotaDebitoEmail_Model model) { var emails = new List <string>(this.Request["Email2"].Split(',')).ConvertAll(s => Convert.ToBoolean(s)); var in_isos = new List <string>(this.Request["in_iso"].Split(',')).ConvertAll(s => Convert.ToInt32(s)); var in_ho_ids = new List <string>(this.Request["in_ho_id"].Split(',')).ConvertAll(s => Convert.ToInt32(s)); var in_numbers = new List <string>(this.Request["in_number"].Split(',')).ConvertAll(s => Convert.ToInt32(s)); var in_dates = new List <string>(this.Request["in_date"].Split(',')).ConvertAll(s => DateTime.Parse(s)); var list = new List <EmailInfo>(); for (int i = 0; i < in_isos.Count; i++) { int in_iso = in_isos[i]; int ho_id = in_ho_ids[i]; int in_number = in_numbers[i]; DateTime in_date = in_dates[i]; bool email = emails[i]; if (email) { list.Add(new EmailInfo() { IsoId = in_iso, HoId = ho_id, InNumber = in_number, InDate = in_date, Subject = model.Subject, Body = model.Body, CC = model.CC }); } } if (list.Count > 0) { var cc = model.CC; ServiceAccess.Instance.EmailNotaDebito(list); } return(RedirectToAction("NotaDebitoEmail")); }
public ActionResult NotaDebitoEmail(NotaDebitoEmail_Model model) { if (this.ModelState.IsValid) { ViewData["NotaDebitoList"] = PTFDataAccess.SelectForNotaDebitosPerHeadOffice(model.Country, model.FromDate, model.ToDate, model.HeadOffice); } ViewData["CountryList"] = HttpContext.Application.Get <List <CountryDetail> >("CountryList", Helper.CreateCountryDropDownLoadFunction()).CreateSelectList( (c) => string.Format("{0} - {1}", c.Country, c.Iso2), (c) => c.Number.ToString()); ViewData["HeadOfficeList"] = HttpContext.Session.Get <List <SelectListItem> >("Empty", Helper.CreateEmptyLoadFunction()); ViewData["RetailerList"] = HttpContext.Session.Get <List <SelectListItem> >("Empty", Helper.CreateEmptyLoadFunction()); return(View(model)); }