Esempio n. 1
0
        private void CreateReportandSaveToDB(string schoolYear, string schoolCode, string publishCycle, string GoalType, string schoolName, string schoolNameB)
        {
            string reportName = WebConfig.getValuebyKey("PublishDocumentName");

            string userID = WorkingProfile.UserID;


            string publishDate = DateFC.YMD(DateTime.Now);

            Byte[] pdfReport = ReportRender.GetOneReport(reportName, userID, schoolYear, schoolCode, "1");

            string result = PushToSP.PublishPLFtoSharePointSite("SLIP", pdfReport, schoolYear, schoolCode, schoolName, schoolNameB);

            //  UploadFileToSharePointSite.PushToSite("SLIP", pdfReport, schoolYear, schoolCode, schoolName, schoolNameB);
            if (result == "Successful")
            {
                string action        = btnReturn.Text;
                string signOffResult = SignOff.Signature2(action, userID, schoolYear, schoolCode, "Publish", publishDate);
                // SaveSLIPPublishDataToHistoryDirectory(schoolCode + ".PDF", pdfReport);
                errorlabel.Text      = "The School PLF has been published to School Web site.";
                errorlabel.ForeColor = Color.Red;
                //   PushToSP.SaveFileToHistoryFolder(WorkingProfile.SchoolYear, schoolCode + ".PDF", pdfReport);
            }
            else
            {
                errorlabel.Text = "The School PLF published failed to School Web site.";
            }
        }
Esempio n. 2
0
        public static void RenderPDF(string reportName, string userID, string schoolYear, string schoolCode, string publishCycle)
        {
            Byte[] pdfReport = ReportRender.GetOneReport(reportName, userID, schoolYear, schoolCode, publishCycle);

            string rFormat = WebConfig.ReportFormat();

            ReportRender.RenderReport(reportName, rFormat, pdfReport);
        }
Esempio n. 3
0
 public void setParameterArray(
     MyParameterRS[] _ParaArray,
     int X,
     string _Name,
     string _Value
     )
 {
     ReportRender.setParameterArray(_ParaArray, X, _Name, _Value);
     // TODO: add assertions to method ReportRenderTest.setParameterArray(MyParameterRS[], Int32, String, String)
 }
Esempio n. 4
0
 public byte[] MultiplePDF(
     string[] mySelectIDArray,
     string reportName,
     string schoolyear,
     string schoolcode,
     string sessionID
     )
 {
     byte[] result
         = ReportRender.MultiplePDF(mySelectIDArray, reportName, schoolyear, schoolcode, sessionID);
     return(result);
     // TODO: add assertions to method ReportRenderTest.MultiplePDF(String[], String, String, String, String)
 }
Esempio n. 5
0
        static void Main(string[] args)
        {
            IATE          ate    = new ATE();
            IReportRender render = new ReportRender();
            BillingSystem bs     = new BillingSystem(ate);

            IContract c1 = ate.RegisterContract(new Subscriber("John", "Smith"), TariffType.Pro);
            IContract c2 = ate.RegisterContract(new Subscriber("James", "Bond"), TariffType.Pro);
            IContract c3 = ate.RegisterContract(new Subscriber("Jansen", "Born"), TariffType.Pro);

            c1.Subscriber.AddMoney(10);

            var t1 = ate.GetNewTerminal(c1);
            var t2 = ate.GetNewTerminal(c2);
            var t3 = ate.GetNewTerminal(c3);

            t1.ConnectToPort();
            t2.ConnectToPort();
            t3.ConnectToPort();

            t1.Call(t2.TelephoneNumber);
            Thread.Sleep(2000);
            t2.EndCall();
            t3.Call(t1.TelephoneNumber);
            Thread.Sleep(1000);
            t3.EndCall();
            t2.Call(t1.TelephoneNumber);
            Thread.Sleep(3000);
            t1.EndCall();

            t1.Disconnect();
            t2.Disconnect();
            t3.Disconnect();

            t3.Call(t1.TelephoneNumber);

            Console.WriteLine();
            Console.WriteLine("Sorted records:");
            foreach (var item in render.SortCalls(bs.GetReport(t1.TelephoneNumber), TypeSort.SortByCallType))
            {
                Console.WriteLine(
                    "Calls:\n Type {0} |\n Date: {1} |\n Duration: {2:mm:ss} | Cost: {3} | Telephone number: {4}",
                    item.CallType,
                    item.Date,
                    item.Time,
                    item.Cost,
                    item.Number);
            }

            Console.ReadKey();
        }
Esempio n. 6
0
        static void Main(string[] args)
        {
            IATE           ate    = new AutomaticTelephoneExchange.ATE();
            IReportRender  render = new ReportRender();
            IBillingSystem bs     = new BillingSystem(ate);

            IContract c1 = ate.RegisterContract(new Subscriber("Leo", "Smith"), Enums.TariffType.Light);
            IContract c2 = ate.RegisterContract(new Subscriber("Jack", "Jones"), Enums.TariffType.Pro);
            IContract c3 = ate.RegisterContract(new Subscriber("Harry", "Williams"), Enums.TariffType.Light);

            c1.Subscriber.AddMoney(10);
            var t1 = ate.GetNewTerminal(c1);
            var t2 = ate.GetNewTerminal(c2);
            var t3 = ate.GetNewTerminal(c3);

            t1.ConnectToPort();
            t2.ConnectToPort();
            t3.ConnectToPort();
            t1.Call(t2.Number);
            Thread.Sleep(2000);
            t2.EndCall();
            t3.Call(t1.Number);
            Thread.Sleep(60000);
            t3.EndCall();
            t2.Call(t1.Number);
            Thread.Sleep(3000);
            t1.EndCall();

            Console.WriteLine();
            Console.WriteLine("Sorted records:");
            foreach (var item in render.SortCalls(bs.GetReport(t1.Number), Enums.TypeSort.SortByCallType))
            {
                Console.WriteLine("Calls:\n Type {0} |\n Date: {1} |\n Duration: {2} | Cost: {3} | Telephone number: {4}",
                                  item.CallType, item.Date, item.Time.ToString("mm:ss"), item.Cost, item.Number);
            }

            Console.ReadKey();
        }
Esempio n. 7
0
        static void Main(string[] args)
        {
            Billing.BL.Classes.Billing billing = new Billing.BL.Classes.Billing();
            IReportRender render      = new ReportRender();
            Sorted        sorted      = new Sorted();
            IATE          ate         = new ATE.BL.Classes.ATE(billing);
            ISubscriber   subscriber1 = new Subscriber("Kesey", "Ken");
            IContract     contract1   = new Contract(subscriber1, TariffType.Tarif1, DateTime.Now);
            IPort         port1       = new Port();
            ITerminal     terminal1   = new Terminal(contract1.Number, port1);
            ISubscriber   subscriber2 = new Subscriber("Vonnegut", "Kurt");
            IContract     contract2   = new Contract(subscriber2, TariffType.Tarif2, DateTime.Now);
            IPort         port2       = new Port();
            ITerminal     terminal2   = new Terminal(contract2.Number, port2);
            ISubscriber   subscriber3 = new Subscriber("Feynman", "Richard");
            IContract     contract3   = new Contract(subscriber3, TariffType.Tarif3, DateTime.Now);
            IPort         port3       = new Port();
            ITerminal     terminal3   = new Terminal(contract3.Number, port3);

            billing.RegisterContract(contract1);
            billing.RegisterContract(contract2);
            billing.RegisterContract(contract3);
            ate.AddUsersData(terminal1);
            ate.AddUsersData(terminal2);
            ate.AddUsersData(terminal3);
            terminal1.ConnectToPort();
            terminal2.ConnectToPort();
            terminal3.ConnectToPort();


            //проверка соединения (случай, когда вызываемый абонент отвечает на звонок)
            Console.WriteLine("------t2 answer t1-------");
            terminal1.Call(terminal2.TelephonNumber);
            Thread.Sleep(2000);
            terminal2.EndCall();
            Console.WriteLine();
            Console.WriteLine("------t1 answer t3-------");
            terminal3.Call(terminal1.TelephonNumber);
            Thread.Sleep(2000);
            terminal3.EndCall();
            Console.WriteLine();
            //проверка соединения (случай, когда вызываемый абонент не отвечает на звонок)
            Console.WriteLine("------t2 reject t3-------");
            terminal3.Call(terminal2.TelephonNumber);
            Console.WriteLine();
            //проверка соединения (попытка дозвониться самому себе)
            Console.WriteLine("------t1 call t1-------");
            terminal1.Call(terminal1.TelephonNumber);
            Console.WriteLine();
            //проверка соединения (попытка дозвониться на несуществующий номер)
            Console.WriteLine("------t1 call 1234-------");
            terminal1.Call(1234);
            Console.WriteLine();
            //проверка соединения (случай, когда вызываемый терминал не подключен к порту)
            Console.WriteLine("------t1 call to disconnect t2-------");
            terminal2.DisconnectFromPort();
            terminal1.Call(terminal2.TelephonNumber);
            Thread.Sleep(2000);
            terminal2.EndCall();
            Console.WriteLine();

            // отчет для абонента 1
            sorted.ShowSortedCallInfo(render, billing, terminal1);
            Console.WriteLine("-----------------------------------------------");
            // счет к оплате за месяц
            Console.WriteLine("Invoice for payment: {0}", billing.PayInvoice(contract1, DateTime.Now.Month));
            // актуальный баланс
            Console.WriteLine(" Current balance: {0}", subscriber1.ShowBalance());
            // оплатить по счету
            subscriber1.RemoveMoney(billing.PayInvoice(contract1, DateTime.Now.Month));
            Console.WriteLine("Payment accepted");
            // актуальный баланс
            Console.WriteLine(" Current balance: {0}", subscriber1.ShowBalance());
            // пополнить баланс
            subscriber1.AddMoney(30);
            // актуальный баланс
            Console.WriteLine(" Current balance: {0}", subscriber1.ShowBalance());

            // попытка смены тарифного плана
            Console.WriteLine();
            Console.WriteLine(contract1.ChangeTariff(TariffType.Tarif2)
                ? "Tariff has changed!"
                : "Wait until the end of the month!");
            Console.WriteLine();

            // для проверки возможности изменения тарифа
            Console.WriteLine(contract1.ChangeTariff(TariffType.Tarif3, DateTime.Now.AddMonths(-3).Date)
                ? "Tariff has changed!"
                : "Wait until the end of the month!");
            Console.WriteLine();

            Console.ReadKey();
        }
Esempio n. 8
0
 public byte[] GetReportR2(string _reportName, MyParameterRS[] _reportParameter)
 {
     byte[] result = ReportRender.GetReportR2(_reportName, _reportParameter);
     return(result);
     // TODO: add assertions to method ReportRenderTest.GetReportR2(String, MyParameterRS[])
 }
Esempio n. 9
0
 public void RenderReport(string _reportName, MyParameterRS[] _reportParameter)
 {
     ReportRender.RenderReport(_reportName, _reportParameter);
     // TODO: add assertions to method ReportRenderTest.RenderReport(String, MyParameterRS[])
 }