public override View CreateNodeView(TreeNode node, Java.Lang.Object value) { var inflater = Application.Context.GetSystemService(Context.LayoutInflaterService) as LayoutInflater; View view = inflater.Inflate(Resource.Layout.layout_icon_node, null, false); var iconTreeItem = value.JavaCast <IconTreeItem>(); var tvValue = view.FindViewById <TextView>(Resource.Id.node_value); tvValue.Text = iconTreeItem.Text; PrintView iconView = view.FindViewById <PrintView>(Resource.Id.icon); iconView.SetIconText(iconTreeItem.Icon); arrowView = view.FindViewById <PrintView>(Resource.Id.arrow_icon); view.FindViewById(Resource.Id.btn_addFolder).Click += (sender, e) => { TreeNode newFolder = new TreeNode(new IconTreeItem(Resource.String.ic_folder, "New Folder")); TreeView.AddNode(node, newFolder); }; view.FindViewById(Resource.Id.btn_delete).Click += (sender, e) => { TreeView.RemoveNode(node); }; //if My computer if (node.Level == 1) { view.FindViewById(Resource.Id.btn_delete).Visibility = ViewStates.Gone; } return(view); }
public ActionResult Print() { var fullList = new List <PrintView>(); //Retrieve list records from DB var medsList = db.Medications.ToList(); var meth = new Methods(); int[] qtys = meth.GetQuantityAvailable(); foreach (Medication med in medsList) { //populate/hydrate one rec PrintView pvm = new PrintView(); pvm.Description = med.Description; pvm.AlertThreshold = med.AlertThreshold; pvm.Quantity = qtys[med.ID]; pvm.ModifiedByDate = med.ModifiedDate; pvm.ModifiedbyUser = med.AppUser.Email; pvm.CreatedByDate = med.CreatedDate; pvm.CreatedByEmail = med.AppUser.Email; //Add one rec to the fullList fullList.Add(pvm); } return(View(fullList)); }
public override View CreateNodeView(TreeNode node, Java.Lang.Object value) { var inflater = Application.Context.GetSystemService(Context.LayoutInflaterService) as LayoutInflater; View view = inflater.Inflate(Resource.Layout.layout_social_node, null, false); var socialItem = value.JavaCast <SocialItem>(); PrintView iconView = view.FindViewById <PrintView>(Resource.Id.icon); iconView.SetIconText(socialItem.Icon); TextView connectionsLabel = view.FindViewById <TextView>(Resource.Id.connections); var rdm = new Random(); connectionsLabel.Text = rdm.Next(150) + " connections"; TextView userNameLabel = view.FindViewById <TextView>(Resource.Id.username); userNameLabel.Text = NAMES[rdm.Next(4)]; TextView sizeText = view.FindViewById <TextView>(Resource.Id.size); sizeText.Text = rdm.Next(10) + " items"; return(view); }
public override View CreateNodeView(TreeNode node, Java.Lang.Object value) { var inflater = Application.Context.GetSystemService(Context.LayoutInflaterService) as LayoutInflater; View view = inflater.Inflate(Resource.Layout.layout_selectable_header, null, false); var iconTreeItem = value.JavaCast <IconTreeItem>(); tvValue = view.FindViewById <TextView>(Resource.Id.node_value); tvValue.Text = iconTreeItem.Text; PrintView iconView = view.FindViewById <PrintView>(Resource.Id.icon); iconView.SetIconText(iconTreeItem.Icon); arrowView = view.FindViewById <PrintView>(Resource.Id.arrow_icon); if (node.IsLeaf) { arrowView.Visibility = ViewStates.Gone; } nodeSelector = view.FindViewById <CheckBox>(Resource.Id.node_selector); nodeSelector.CheckedChange += (sender, e) => { node.Selected = e.IsChecked; foreach (var childNode in node.Children) { TreeView.SelectNode(childNode, e.IsChecked); } }; nodeSelector.Checked = node.Selected; return(view); }
/// <summary> /// Print the document /// </summary> private void Print() { // We need to build the flowdocument in code behind, otherwise there will be no paging with Lists and UIBlocks.... var flowDocument = new FlowDocument(); flowDocument.PageWidth = 650; flowDocument.PageHeight = 900; var title = new Paragraph(new Run($"{CurrentFortressData.FortressName} emergency sheet") { FontSize = 25 }); var subtitle = new Paragraph(new Run("Category => Name => Username => Password") { FontSize = 12 }); flowDocument.Blocks.Add(title); flowDocument.Blocks.Add(subtitle); var list = new List(); foreach (var printableVm in PrintablePasswordEntries) { var pwEntry = $"{printableVm.Category} - {printableVm.Name} - {printableVm.Username}:{Environment.NewLine}{printableVm.Password}"; var para = new Paragraph(new Run(pwEntry)) { Margin = new System.Windows.Thickness(12, 0, 12, 0) }; list.ListItems.Add(new ListItem(para)); } flowDocument.Blocks.Add(list); // It is crucial, that we create the xps file in memory only and never write it onto the harddrive. var package = Package.Open(new MemoryStream(), FileMode.Create, FileAccess.ReadWrite); var packUri = new Uri("pack://temp.xps"); PackageStore.RemovePackage(packUri); PackageStore.AddPackage(packUri, package); var xpsDocument = new XpsDocument(package, CompressionOption.SuperFast, packUri.ToString()); var paginator = ((IDocumentPaginatorSource)flowDocument).DocumentPaginator; new XpsSerializationManager(new XpsPackagingPolicy(xpsDocument), false) .SaveAsXaml(paginator); Document = xpsDocument.GetFixedDocumentSequence(); // Show the printable Document var printView = new PrintView(Document); printView.DataContext = this; printView.Show(); }
public ActionResult Print(int id) { var model = new PrintView(); using (GarageManagementEntities entities = new GarageManagementEntities()) { model.Products = entities.booking_cost.Include("ServicesAndParts").Where(x => x.BookingId == id).ToList(); model.Booking = entities.Bookings.Include("Customer").Include("BookingTypes").FirstOrDefault(x => x.Id == id); } return(View(model)); }
public override View CreateNodeView(TreeNode node, Java.Lang.Object value) { var inflater = Application.Context.GetSystemService(Context.LayoutInflaterService) as LayoutInflater; View view = inflater.Inflate(Resource.Layout.layout_profile_node, null, false); var tvValue = view.FindViewById <TextView>(Resource.Id.node_value); var iconTreeItem = value.JavaCast <IconTreeItem>(); tvValue.Text = iconTreeItem.Text; PrintView iconView = view.FindViewById <PrintView>(Resource.Id.icon); iconView.SetIconText(iconTreeItem.Icon); return(view); }
private void btPrint_Click(object sender, EventArgs e) { if (data.GetActiveBack() == null) { MessageBox.Show("No hay ningun estilo de tarjeta activo"); return; } UpdateChoferes(); if (printview == null) { printview = new PrintView(data); } printview.Show(this); printview.LoadData(); }
public ActionResult View(long?id) { var order = repository.GetOrder(subdomainid.Value, id.Value); organisation sender = order.user1.organisation1; var receiverAddress = order.receiverAddress; if (order.receiverUserid.HasValue) { receiverAddress = order.user.organisation1.ToFullOrganisationAddress(); } // log activity // only log this if viewed by the receiver if (order.receiverUserid.HasValue && sessionid.Value == order.receiverUserid.Value && order.status == OrderStatus.SENT.ToString()) { repository.AddActivity(order.owner, new ActivityMessage(order.id, order.owner, ActivityMessageType.ORDER_VIEWED, new HtmlLink(order.orderNumber.ToString("D8"), order.id).ToTransactionString(TransactionType.ORDER), new HtmlLink(order.user.ToEmailName(true), order.receiverUserid.Value).ToContactString()), sender.subdomain); repository.UpdateOrderStatus(order.id, TransactionType.ORDER, null, sessionid.Value, OrderStatus.VIEWED); } var primaryView = new OrderView(order, sender, receiverAddress, sessionid.Value, TransactionType.ORDER); primaryView.SetStatusRibbon(!primaryView.order.isOwner); primaryView.SetButtonsToShow(TransactionType.ORDER, !primaryView.order.isOwner); primaryView.comments = order.ToTransaction().comments.OrderByDescending(x => x.created).ToModel(true); if (Request.HttpMethod == "POST") { return(View("orderView", primaryView)); } var printView = new PrintView(baseviewmodel) { transactionID = order.ToTransaction().id, primaryView = primaryView }; return(View("PrintView", printView)); }
public ActionResult View(long?id) { var invoice = repository.GetOrder(subdomainid.Value, id.Value); organisation sender = invoice.user1.organisation1; var receiverAddress = invoice.receiverAddress; if (invoice.receiverUserid.HasValue) { receiverAddress = invoice.user.organisation1.ToFullOrganisationAddress(); } // log activity if (invoice.receiverUserid.HasValue && sessionid.Value == invoice.receiverUserid.Value && invoice.status == OrderStatus.SENT.ToString()) { // update status repository.AddActivity(invoice.owner, new ActivityMessage(invoice.id, invoice.owner, ActivityMessageType.INVOICE_VIEWED, new HtmlLink(invoice.orderNumber.ToString("D8"), invoice.id).ToTransactionString(TransactionType.INVOICE), new HtmlLink(invoice.user.ToEmailName(true), invoice.receiverUserid.Value).ToContactString()), sender.subdomain); repository.UpdateOrderStatus(id.Value, TransactionType.INVOICE, null, sessionid.Value, OrderStatus.VIEWED); } var primaryView = new OrderView(invoice, sender, receiverAddress, sessionid.Value, TransactionType.INVOICE); primaryView.SetStatusRibbon(!primaryView.order.isOwner); primaryView.SetButtonsToShow(TransactionType.INVOICE, !primaryView.order.isOwner); primaryView.comments = invoice.ToTransaction().comments.OrderByDescending(x => x.created).ToModel(true); if (Request.HttpMethod == "POST") { return(View("invoiceView", primaryView)); } var printView = new PrintView(baseviewmodel) { transactionID = invoice.ToTransaction().id, primaryView = primaryView }; return(View("PrintView", printView)); }
public override View CreateNodeView(TreeNode node, Java.Lang.Object value) { var inflater = Application.Context.GetSystemService(Context.LayoutInflaterService) as LayoutInflater; View view = inflater.Inflate(Resource.Layout.layout_place_node, null, false); var placeItem = value.JavaCast <PlaceItem>(); var placeName = view.FindViewById <TextView>(Resource.Id.place_name); placeName.Text = placeItem.Name; Random r = new Random(); bool like = r.Next(2) > 0; PrintView likeView = view.FindViewById <PrintView>(Resource.Id.like); likeView.SetIconText(like ? Resource.String.ic_thumbs_up: Resource.String.ic_thumbs_down); return(view); }
private void LoadPrintViewPage(object o, int Report) { if (!MainTableControl.Controls.ContainsKey("tpPrintView")) { PrintView uc = new PrintView(); TabPage tp = new TabPage(); uc.Dock = DockStyle.Fill; uc.datasource = o; uc.Report = Report; tp.Controls.Add(uc); tp.Name = "tpPrintView"; tp.Text = "打印预览"; tp.Font = new Font("宋体", 9); this.MainTableControl.Controls.Add(tp); this.MainTableControl.SelectTab("tpPrintView"); } else { this.MainTableControl.SelectTab("tpPrintView"); } }
public override View CreateNodeView(TreeNode node, Java.Lang.Object value) { var inflater = Application.Context.GetSystemService(Context.LayoutInflaterService) as LayoutInflater; View view = inflater.Inflate(Resource.Layout.layout_header_node, null, false); var iconTreeItem = value.JavaCast <IconTreeItem>(); var tvValue = view.FindViewById <TextView>(Resource.Id.node_value); tvValue.Text = iconTreeItem.Text; PrintView iconView = view.FindViewById <PrintView>(Resource.Id.icon); iconView.SetIconText(iconTreeItem.Icon); arrowView = view.FindViewById <PrintView>(Resource.Id.arrow_icon); if (node.IsLeaf) { arrowView.Visibility = ViewStates.Invisible; } return(view); }
public PrintDocumentHandler() { Control = new PrintView { Handler = this }; }