public ActionResult ProcessNotClosedOrders() { OrdersContext context = new OrdersContext(); IQueryable <Order> orders = context.OrdersNotClosed; IQueryable users = OrdersUser.getAllUsers(); List <string> mailToList = new List <string>(); foreach (OrdersUser user in users) { if (user.SendAllMail || user.SendAllCreateMail || user.Name.Contains("SVOD")) { if (user.Mails.Count > 0) { foreach (string mail in user.Mails) { if (!String.IsNullOrEmpty(mail)) { mailToList.Add(mail); } } } } } //mailToList.Add("*****@*****.**"); MailContext.sendOrdersListTable("Местные заявки", orders.ToList(), mailToList); return(View()); }
protected void refreshSelObject() { OrdersUser selectedUser = gridUsers.SelectedItem as OrdersUser; cancelEdit(); if (selectedUser != null) { CurrentUser = selectedUser; } }
private void btnAddItem_Click(object sender, RoutedEventArgs e) { cancelEdit(); OrdersUser newUser = new OrdersUser(); newUser.UserID = UserID--; isNew = true; CurrentUser = newUser; userForm.CurrentItem = CurrentUser; Login.IsEnabled = isNew; }
private void lstSelUsers_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { try { filter = DataContext as OrderFilter; OrdersUser user = lstSelUsers.SelectedItem as OrdersUser; if (filter.SelectedUsers.Contains(user)) { filter.SelectedUsers.Remove(user); } } catch { } }
private void lstUsers_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { OrdersUser user = lstUsers.SelectedItem as OrdersUser; if ((CurrentOrder.AgreeText == null) || (CurrentOrder.AgreeUsersDict == null)) { CurrentOrder.AgreeText = ""; CurrentOrder.AgreeUsersDict = new Dictionary <int, string>(); } if (user != null) { if (CurrentOrder.AgreeUsersDict.Keys.Contains(user.UserID)) { CurrentOrder.AgreeUsersDict.Remove(user.UserID); } else { CurrentOrder.AgreeUsersDict.Add(user.UserID, user.FullName); } CurrentOrder.AgreeText = string.Join("; ", from string name in CurrentOrder.AgreeUsersDict.Values select name); CurrentOrder.AgreeUsersIDSText = string.Join(";", from int key in CurrentOrder.AgreeUsersDict.Keys select key.ToString()); } }
private void btnCancel_Click(object sender, RoutedEventArgs e) { cancelEdit(); CurrentUser = null; userForm.CurrentItem = null; }
public IQueryable <OrdersUser> LoadOrdersUsers() { Logger.info("Получение списка пользователей (LoadUsers)", Logger.LoggerSource.service); return(OrdersUser.getAllUsers().AsQueryable()); }
public void RegisterDeleteUser(OrdersUser newObject) { Logger.info("удаление пользователя " + newObject.FullName, Logger.LoggerSource.service); usrContext.RegisterDeleteUser(newObject); }
public void UpdateOrdersUser(OrdersUser obj) { //Logger.info("Сервис: Update " + obj.FullName); //context.UpdateOrder(order); }