/// <summary> /// Upload excel for flight schedule /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void UploadMenuItemsBtnClicked(object sender, EventArgs e) { if (RadAsyncUploadBaseItem.UploadedFiles.Count == 0) { return; } UploadedFile attachment = RadAsyncUploadBaseItem.UploadedFiles[0]; bool validInput = InvalidUploadInput(); if (!validInput) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "InValidUploadFile", "InValidUploadFile();", true); return; } int userId = Convert.ToInt32(Session["USERID"]); var user = _accountManagement.GetUserById(userId); string notificationEmails = (System.Configuration.ConfigurationManager.AppSettings["NotificationEmails"]); var emails = notificationEmails.Split(new char[] { ';' }); //valid schedule, upload it _menuProcessor.ImportBaseMenuItems(attachment.InputStream); var defaultMessage = EmailHelper.BaseMenuItemsUploadTemplate; EmailHelper.SendMail(user.Username, "*****@*****.**", "EMMA- Base Menu Items Upload - " + attachment.FileName, defaultMessage); foreach (var email in emails) { if (!string.IsNullOrEmpty(email)) { EmailHelper.SendMail(email, "*****@*****.**", "EMMA- Base Menu Items Upload - " + attachment.FileName, defaultMessage); } } ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "UploadCompleted", "UploadCompleted();", true); }