public Additional_InformationWindow(Clientas client, Clientas client2, int idApplication)
 {
     InitializeComponent();
     forClient  = client;
     fromClient = client2;
     num        = idApplication;
 }
 //Методы
 public PurchaseWindow(Clientas client, string num)
 {
     InitializeComponent();
     this.client   = client;
     numOperations = num;
     controller    = new PurchaseController(this);
 }
 //Обработка кнопки  удаления
 public void PushButtonDelete()
 {
     try
     {
         if (window.clientsGrid.SelectedItems != null && window.clientsGrid.SelectedIndex != -1)
         {
             int index = window.clientsGrid.SelectedIndex;
             //Удаление контакта из датагрид
             for (int i = 0; i < window.clientsGrid.SelectedItems.Count; i++)
             {
                 DataRowView datarowView = window.clientsGrid.SelectedItems[i] as DataRowView;
                 if (datarowView != null)
                 {
                     DataRow  dataRow = (DataRow)datarowView.Row;
                     Clientas client  = new Clientas(int.Parse(dataRow[0].ToString()), dataRow[1].ToString(),
                                                     dataRow[2].ToString(), dataRow[3].ToString(), dataRow[4].ToString());
                     //Удалить контакт из списка контакто
                     mngRiealtorAgency.Agency.DeleteClientList(client);
                     dataRow.Delete();
                 }
             }
         }
         //Обновить нашу БД с клиентами
         mngRiealtorAgency.Agency.GetWorkerBD.UpdateDBandList();
     }
     catch (Exception)
     {
         MessageBox.Show("Не шалите");
     }
 }
 //Методы
 public ExchangeWindow(Clientas client, string num)
 {
     InitializeComponent();
     numOperations = num;
     this.client   = client;
     controll      = new ExchangeControll(this);
 }
Example #5
0
        private Clientas client      = null;                                   //Сам клиент


        //Методы
        public About(Clientas client)
        {
            InitializeComponent();
            this.client = client;
            controll    = new AboutController(this);
            //заполнение таблицы
            FillDataTables();
        }
Example #6
0
 public bool Equals(Clientas client)
 {
     if (client.name.Equals(this.name) &&
         this.lastName.Equals(client.lastName) &&
         client.patronymic.Equals(this.patronymic) &&
         client.ID == this.ID)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #7
0
 public override bool Equals(object obj)
 {
     if (obj == null)
     {
         return(false);
     }
     if (obj is Clientas)
     {
         Clientas client = (Clientas)obj;
         return(this.Equals(client));
     }
     else
     {
         return(false);
     }
 }
 //Методы
 public AddApplication(Clientas client, RiealtorAgencyDB riealtorAgency)
 {
     InitializeComponent();
     controller  = new AddApplicationController(this);
     this.client = client;
 }
 public void AddClient(Clientas client)
 {
     manager.AddClient(client);
 }
 public void DeleteClientList(Clientas client)
 {
     manager.DeleteClientList(client);
 }
        /// <summary>
        /// Получение списка предложений
        /// </summary>
        /// <param name="idClient">Номер клиента</param>
        /// <param name="idApplication">Номер заявки</param>
        /// <param name="offers">Таблица предложений</param>
        public void GetListOffers(string idClient, string idApplication, DataTable offers)
        {
            int    INTid = int.Parse(idApplication);
            string tpy;

            //Очищаем записи
            offers.Clear();
            if (offers == null)
            {
                offers = new DataTable("List offers");
            }

            //Получаем клиента для которого нужно вывести предложения
            Clientas client = GetClientID(int.Parse(idClient));

            //Заполнить лист потенциальных предложений
            List <Clientas> pList = ClientsExceptID(int.Parse(idClient));


            //Получить тип операции
            if (client.GetApplicationByNum(INTid).GetTypeApplication() == Operation.EXCHANGE)
            {
                tpy = "Обмен";
            }
            else if (client.GetApplicationByNum(INTid).GetTypeApplication() == Operation.SALE)
            {
                tpy = "Продажа";
            }
            else if (client.GetApplicationByNum(INTid).GetTypeApplication() == Operation.PURCHASE)
            {
                tpy = "Покупка";
            }
            else
            {
                tpy = null;
            }

            //Случай с продажей
            if (tpy.Equals("Продажа"))
            {
                for (int i = 0; i < pList.Count; i++)
                {
                    for (int j = 0; j < pList[i].application.Count; j++)
                    {
                        //Отбираем заявки с типом = ПОКУПКА
                        if (pList[i].application[j].GetTypeApplication() == Operation.PURCHASE &&
                            ((Purchase)pList[i].application[j]).AppropriateHome(client.GetApplicationByNum(INTid).Home))
                        {
                            DataRow newRow;
                            newRow = offers.NewRow();
                            newRow["Тип операции"]        = "Покупка";
                            newRow["Информация о заявке"] = ((Purchase)pList[i].application[j]).ToString();
                            newRow["Номер заявки"]        = pList[i].application[j].number;
                            offers.Rows.Add(newRow);
                        }
                    }
                }
            }
            else if (tpy.Equals("Покупка"))
            {
                for (int i = 0; i < pList.Count; i++)
                {
                    for (int j = 0; j < pList[i].application.Count; j++)
                    {
                        //Отбираем заявки с типом = Продажа
                        if (pList[i].application[j].GetTypeApplication() == Operation.SALE &&
                            ((Sale)pList[i].application[j]).AppropriateHome(client.GetApplicationByNum(INTid).Home))
                        {
                            DataRow newRow;
                            newRow = offers.NewRow();
                            newRow["Тип операции"]        = "Продажа";
                            newRow["Информация о заявке"] = ((Sale)pList[i].application[j]).ToString();
                            newRow["Номер заявки"]        = pList[i].application[j].number;
                            offers.Rows.Add(newRow);
                        }
                    }
                }
            }
            else if (tpy.Equals("Обмен"))
            {
                for (int i = 0; i < pList.Count; i++)
                {
                    for (int j = 0; j < pList[i].application.Count; j++)
                    {
                        //Отбираем заявки с типом = Продажа
                        if (pList[i].application[j].GetTypeApplication() == Operation.EXCHANGE &&
                            ((Exchange)pList[i].application[j]).AppropriateHome(((Exchange)client.GetApplicationByNum(INTid)).Home,
                                                                                ((Exchange)client.GetApplicationByNum(INTid)).Home2))
                        {
                            DataRow newRow;
                            newRow = offers.NewRow();
                            newRow["Тип операции"]        = "Обмен";
                            newRow["Информация о заявке"] = ((Exchange)pList[i].application[j]).ToString();
                            newRow["Номер заявки"]        = pList[i].application[j].number;
                            offers.Rows.Add(newRow);
                        }
                    }
                }
            }
        }
 public void AddApplication(Clientas client)
 {
     workerDB.AddApplication(client);
 }