コード例 #1
0
        public ActionResult TrialBal(FormCollection fc)
        {
            GenHelper g       = new GenHelper();
            DataSet   ds      = new DataSet();
            String    repname = "TrialBalance";
            String    Tblname = "mytrialbal";

            DBClass.NonQuery("drop table " + Tblname);
            Reports rp  = new Reports();
            String  Mon = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Convert.ToInt32(fc["mon"]));

            String    Stdate = fc["year"] + "-" + fc["mon"] + "-" + "01";
            DateTime  sd     = DateTime.Parse(Stdate);
            DateTime  ed     = sd.AddMonths(1); ed = ed.AddDays(-1);
            String    edate  = g.SqlDate(ed.ToString());
            DataTable trbal  = rp.PrepareTraialBal(Tblname, Stdate, edate);
            String    SumQry = "select sum(receipts) as TotalCredits,sum(payments) as TotalDebits from " + Tblname;
            DataTable sumdt  = DBClass.GetData(SumQry);

            ds.Tables.Add(trbal); ds.Tables.Add(sumdt);
            float[] cols = new float[] { 60f, 180f, 65f, 65f, 65f, 65f };
            String  path = Server.MapPath("/pdfs/trialbalance.pdf");

            String[] rephead = new String[] { "N.EW.K.R.T.C Hubli", "Trial Balance For the Month of " + Mon + " " + fc["year"] };
            String[] tblhead = new string[] { "Account Number", "Account Name", "Opening Balance", "Receipts", "Payments", "Closing Balance" };
            pdf      ph      = new pdf(ds, cols, rephead, tblhead, path, repname, Tblname);

            ph.GenerateReport();
            //String DropQry = "drop table " + Tblname;
            //DBClass.NonQuery(DropQry);
            return(File(path, "application/pdf"));
        }
コード例 #2
0
        public async Task <ActionResult <pdf> > Postpdf(pdf pdf)
        {
            _context.pdfs.Add(pdf);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(Getpdf), new pdf {
                Id = pdf.Id
            }, pdf));
        }
コード例 #3
0
        public IActionResult Editor(string editor)
        {
            pdf modeldata = new pdf();

            modeldata.body = editor;
            return(new ViewAsPdf("_pdfPartial", modeldata)
            {
                FileName = "MyPdfFile.pdf"
            });
        }
コード例 #4
0
        public async Task <IActionResult> Putpdf(long id, pdf pdf)
        {
            if (id != pdf.Id)
            {
                return(BadRequest());
            }

            _context.Entry(pdf).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(NoContent());
        }
コード例 #5
0
        public ActionResult pdf()
        {
            DataSet ds = new DataSet();

            int[]   sumcolindex = { 3, 4, 5, 6 };
            float[] cols        = new float[] { 35f, 40f, 220f, 50f, 50f, 50f, 50f, 50f };
            String  path        = Server.MapPath("/pdfs/test.pdf");

            String[]  rephead = new String[] { "N.EW.K.R.T.C Hubli", "Account List " };
            String[]  tblhead = new String[] { "Account Id", "Account Number", "Account Name", "Parent Id", "Group Id", "Section Id", "Allow", "Active" };
            DataTable dt      = DBClass.GetData("select * from account_master");

            ds.Tables.Add(dt);
            pdf ph = new pdf(ds, cols, rephead, tblhead, path);

            ph.GenerateReport();
            return(File(path, "application/pdf"));
        }
コード例 #6
0
        public ActionResult printrp(FormCollection fc)
        {
            DataSet ds      = new DataSet();
            String  repname = "ReceiptPayment";

            Reports rs = new Reports(); GenHelper g = new GenHelper();

            float[] cols = new float[] { 40f, 220f, 60f, 60f };
            String  path = Server.MapPath("/pdfs/receiptpayments.pdf");

            String[]  rephead = new String[] { "N.EW.K.R.T.C Hubli", "Receipts & Payments From " + fc["stdate"] + " To " + fc["edate"] };
            String[]  tblhead = new string[] { "Account Number", "Account Name", "Receipts", "Payments" };
            DataTable dt      = rs.GetRpData(fc["stdate"], fc["edate"]);

            ds.Tables.Add(dt);
            DataTable dt1 = DBClass.GetData("select sum(cramount) receipts,sum(dramount) payments from accounttrans where trdate>='" + g.SqlDate(fc["stdate"]) + "' and trdate<='" + g.SqlDate(fc["edate"]) + "' and divid=1");

            ds.Tables.Add(dt1);
            pdf ph = new pdf(ds, cols, rephead, tblhead, path, repname);

            ph.GenerateReport();
            return(File(path, "application/pdf"));
        }
コード例 #7
0
        public ActionResult pl()
        {
            Reports   r       = new Reports();
            GenHelper g       = new GenHelper();
            DataSet   ds      = new DataSet();
            String    repname = "placc";
            String    Tblname = "mytrialbal";
            DataTable tb      = r.PrepareTraialBal(Tblname, "2018-06-01", "2018-06-30");
            DataTable pltab   = r.GetPLAccount();
            String    SumQry  = "select (select sum(amount) from receipts ) as receipts,(select sum(amount) from payments) as payments";
            DataTable sumdt   = DBClass.GetData(SumQry);

            ds.Tables.Add(pltab); ds.Tables.Add(sumdt);
            float[] cols = new float[] { 65f, 120f, 65f, 65f, 120f, 65f };
            String  path = Server.MapPath("/pdfs/pandlaccount.pdf");

            String[] rephead = new String[] { "N.EW.K.R.T.C Hubli", "Trial Balance For the Year  " };
            String[] tblhead = new string[] { "Account Number", "Account Name", "Amount", "Account Number", "Account Name", "Amount" };

            pdf ph = new pdf(ds, cols, rephead, tblhead, path, repname, Tblname);

            ph.GenerateReport();
            return(File(path, "application/pdf"));
        }
コード例 #8
0
        public Contents()
        {
            var s = new Label {
                HorizontalTextAlignment = Xamarin.Forms.TextAlignment.Center, Text = "Hertfordshire Primary Care", TextColor = Color.FromHex("1760ae"), Font = Font.SystemFontOfSize(20, FontAttributes.Bold)
            };



            Title = "Hertfordshire primary care";
            var t = new Label {
                HorizontalTextAlignment = Xamarin.Forms.TextAlignment.Center, Text = "Antibiotics Guidelines ", TextColor = Color.FromHex("1760ae"), Font = Font.SystemFontOfSize(20, FontAttributes.Bold)
            };
            var u = new Label {
                Text = "", TextColor = Color.FromHex("1760ae"), FontSize = 10
            };

            //    var u = new Label { Text = "Antibiotics Guidelines" , TextColor = Color.FromHex("1760ae"), FontSize = 10 };
            //   Title = "Contents";
            NavigationPage.SetHasNavigationBar(this, true);

            //  var pharm = database.GetContents();
            // BackgroundColor = Color.White;
            BackgroundColor = Color.FromHex("bdd1f6");
            var data = new List <GetFrontPage>  {
                new GetFrontPage("Treatment Guidelines", "guidelines.png"),

                new GetFrontPage("What's new in this version", "whatsnew.png"),
                //         new GetFrontPage ("About this app","about.png"),
                new GetFrontPage("Restricted Antibiotics", "restricted.png"),
                new GetFrontPage("Penicillin allergy", "penicillin.png"),
                new GetFrontPage("Principles of Treatment", "principles.png"),
                new GetFrontPage("About these guidelines", "about_guideline.png"),
                //   new GetFrontPage ( "Full (pdf) version of the guidelines","pdf.png" ),

                new GetFrontPage("Feedback", "Feedback.png"),
                //       new GetFrontPage (  "Clostridium difficile infection","cdiff.jpg" ),
                //      new GetFrontPage (  "CRP testing","CRP.png" ),
                //    new GetFrontPage (  "Specific Drug Warnings","warning.png" ),
                //               new GetFrontPage(  "(HCT) Guidance","HCT.png"),
                //          new GetFrontPage(  "(HCT) Start Smart Then Focus","startsmart.jpg" ),
                //          new GetFrontPage (  "(HCT) Telephone Prescribing","telephone.jpg" ),
                //          new GetFrontPage (  "(HCT) IV to oral stepdown","iv.jpg" ),
                //        new GetFrontPage (  "(HCT) Gentamicin prescribing","gentamicin.jpg" ),
                //new GetFrontPage (  "(HCT) Gentamicin prescribing","icon.png" ),
                //            new GetFrontPage (  "School Information","school.png"),
            };

            _pharmacylist = new ListView
            {
                BackgroundColor = Color.FromHex("bdd1f6"),

                SeparatorColor = Color.FromHex("#ddd"),
            };
            _pharmacylist.ItemsSource = data;
            var cell = new DataTemplate(typeof(ImageCell));

            cell.SetValue(TextCell.TextColorProperty, Color.FromHex("1760ae"));
            //  cell.SetValue(TextCell.TextProperty, );

            cell.SetBinding(TextCell.TextProperty, "Name");
            cell.SetBinding(ImageCell.ImageSourceProperty, "Image");
            _pharmacylist.ItemTemplate = cell;
            // _pharmacylist.ItemTemplate = new DataTemplate(typeof(ImageCell));
            // _pharmacylist.ItemTemplate.SetBinding(ImageCell.TextProperty, "Name");
            // _pharmacylist.ItemTemplate.SetBinding(ImageCell.ImageSourceProperty, "Image");
            // _pharmacylist.SetValue(TextCell.TextColorProperty, Color.White);
            //  _pharmacylist.HeightRequest = 500;
            _pharmacylist.RowHeight = 65;

            var a = new StackLayout
            {
                Orientation       = StackOrientation.Vertical,
                HorizontalOptions = LayoutOptions.CenterAndExpand

                                    //  Padding = new Thickness (5, 5, 5, 5),
            };

            if (Device.OS == TargetPlatform.Windows)
            {
                //  Padding = new Thickness (5, 5, 5, 5),
                a.Children.Add(s);
                a.Children.Add(t);
                a.Children.Add(u);
                NavigationPage.SetHasNavigationBar(this, false);
            }
            else
            {
                a.Children.Add(t);
                a.Children.Add(u);
            }



            //   var p = new StackLayout
            //   {
            //       Padding = 5,
            //       Children = { title }
            //   };



            var logo = new StackLayout
            {
                Padding     = new Thickness(5, 5, 5, 5),
                Orientation = StackOrientation.Horizontal,

                Children = { new Image {
                                 //     BackgroundColor =Color.White,
                                 VerticalOptions   = LayoutOptions.FillAndExpand,
                                 HorizontalOptions = LayoutOptions.StartAndExpand,
                                 HeightRequest     = 30,
                                 //   WidthRequest=90,
                                 //               Aspect = Aspect.AspectFit,//.AspectFit//.Fill
                                 Source = ImageSource.FromFile("th.jpg")
                             },
                             new Image {
                                 //     BackgroundColor =Color.White,
                                 VerticalOptions   = LayoutOptions.FillAndExpand,
                                 HorizontalOptions = LayoutOptions.EndAndExpand,
                                 HeightRequest     = 30,
                                 //   WidthRequest=90,
                                 //               Aspect = Aspect.AspectFit,//.AspectFit//.Fill
                                 Source = ImageSource.FromFile("hbl.png")
                             } }
            };

            var k = new StackLayout
            {
                BackgroundColor = Color.FromHex("bdd1f6"),
                Padding         = 5,
                //  BackgroundColor = Color.White,
                Children = { a,
                             _pharmacylist, logo }
            };

            Content = k;



            _pharmacylist.ItemSelected += (sender, e) => {
                if (e.SelectedItem == null)
                {
                    return;
                }
                var user = (GetFrontPage)e.SelectedItem;
                if (user.Name == "What's new in this version")
                {
                    var tg = new whats_new();
                    Xamarin.Forms.Device.BeginInvokeOnMainThread(() => Navigation.PushAsync(tg));
                }
                if (user.Name == "Feedback")
                {
                    var tg = new feedback();
                    Xamarin.Forms.Device.BeginInvokeOnMainThread(() => Navigation.PushAsync(tg));
                }
                if (user.Name == "Treatment Guidelines")
                {
                    // var nav= new NavigationPage(new pharmacy(database));
                    //       var nav= new NavigationPage(new area_page(database));

                    var tg = new area_page();
                    Xamarin.Forms.Device.BeginInvokeOnMainThread(() => Navigation.PushAsync(tg));
                }
                if (user.Name == "Restricted Antibiotics")
                {
                    var tg = new newpage(1);
                    Xamarin.Forms.Device.BeginInvokeOnMainThread(() => Navigation.PushAsync(tg));
                }


                if (user.Name == "About these guidelines")
                {
                    var tg = new about_guideline();
                    Xamarin.Forms.Device.BeginInvokeOnMainThread(() => Navigation.PushAsync(tg));
                }
                if (user.Name == "Principles of Treatment")
                {
                    var tg = new newpage(2);
                    Xamarin.Forms.Device.BeginInvokeOnMainThread(() => Navigation.PushAsync(tg));
                }
                if (user.Name == "Educational Resources")
                {
                    var tg = new newpage(3);
                    Xamarin.Forms.Device.BeginInvokeOnMainThread(() => Navigation.PushAsync(tg));
                }
                if (user.Name == "Full (pdf) version of the guidelines")
                {
                    var tg = new pdf();
                    Xamarin.Forms.Device.BeginInvokeOnMainThread(() => Navigation.PushAsync(tg));
                }


                if (user.Name == "Penicillin allergy")
                {
                    var tg = new penicillin();
                    Xamarin.Forms.Device.BeginInvokeOnMainThread(() => Navigation.PushAsync(tg));
                }
                if (user.Name == "CRP testing")
                {
                    var tg = new newpage(5);
                    Xamarin.Forms.Device.BeginInvokeOnMainThread(() => Navigation.PushAsync(tg));
                }
                if (user.Name == "School Information")
                {
                    var tg = new newpage(6);
                    Xamarin.Forms.Device.BeginInvokeOnMainThread(() => Navigation.PushAsync(tg));
                }
                if (user.Name == "Specific Drug Warnings")
                {
                    //        var tg = new specific_warnings();
                    //      Navigation.PushAsync(tg);
                }
                if (user.Name == "(HCT) Guidance")
                {
                    var tg = new hct_page();
                    Xamarin.Forms.Device.BeginInvokeOnMainThread(() => Navigation.PushAsync(tg));
                }



                if (e.SelectedItem == null)
                {
                    return;                         // don't do anything if we just de-selected the row
                }
                // do something with e.SelectedItem
                ((ListView)sender).SelectedItem = null; // de-select the row
            };
        }