示例#1
0
        static void Main(string[] args)
        {
            try
            {
                ICrmRepository     DAL = new CrmDal();
                IInvoiceRepository invoiceRepository = new InvoiceDal();
                var bl         = new CrmBl();
                var invoiceBl  = new InvoiceBl();
                var test       = new CrmDal();
                var invoiceDal = new InvoiceDal();
                var optimalBl  = new OptimalBl();
                //var agent = bl.AddServiceAgent("Omer", "111");
                var newagent = new ServiceAgent("Iron", "3456");
                var client   = new Client("hds", "ss", 5555, 3, "yaffo", "0546", 5);
                var package  = new Package("pp", 11, 50, new DateTime(2000, 11, 10), 120, 150, 0.3, true, false, false);

                test.AddPackage(package);
                //var lines = bl.GetClientLines(1);

                // invoiceBl.AddPayment(1, new DateTime(2000, 11, 20), 150);
                //Console.WriteLine(invoiceRepository.GetClientType(4).Id);
                //Console.WriteLine(invoiceBl.GetCallsPayment(4, new DateTime(2000, 11, 10)));
                //var p = invoiceRepository.GetPackage(3);
                //Console.WriteLine(p.PackageName);
                // var calls = invoiceRepository.GetCalls(3, new DateTime(2000,11,10));
                //Console.WriteLine(invoiceBl.GetMinutesLeft(3, new DateTime(2000,11,10)));
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
示例#2
0
        private void btnSubmit_Click(object sender, RoutedEventArgs e)
        {
            var bl = new CrmBl();

            try
            {
                var agent = bl.LoginAgent(txtAgentName.Text, txtPassword.Password.ToString());
                if (agent.AgentName == txtAgentName.Text)
                {
                    this.Dispatcher.Invoke(new Action(() => NavigationService.Navigate(new Menu())), DispatcherPriority.ContextIdle);
                }
                else
                {
                    MessageBox.Show("Agent name or password incorrect");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }