예제 #1
0
        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());
        }
예제 #2
0
        protected void refreshSelObject()
        {
            OrdersUser selectedUser = gridUsers.SelectedItem as OrdersUser;

            cancelEdit();
            if (selectedUser != null)
            {
                CurrentUser = selectedUser;
            }
        }
예제 #3
0
        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;
        }
예제 #4
0
 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());
            }
        }
예제 #6
0
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     cancelEdit();
     CurrentUser          = null;
     userForm.CurrentItem = null;
 }
예제 #7
0
 public IQueryable <OrdersUser> LoadOrdersUsers()
 {
     Logger.info("Получение списка пользователей (LoadUsers)", Logger.LoggerSource.service);
     return(OrdersUser.getAllUsers().AsQueryable());
 }
예제 #8
0
 public void RegisterDeleteUser(OrdersUser newObject)
 {
     Logger.info("удаление пользователя " + newObject.FullName, Logger.LoggerSource.service);
     usrContext.RegisterDeleteUser(newObject);
 }
예제 #9
0
 public void UpdateOrdersUser(OrdersUser obj)
 {
     //Logger.info("Сервис: Update " + obj.FullName);
     //context.UpdateOrder(order);
 }