// Unity methods void Start() { // Start mouseDirection at (0,0) curGesture = new Vector2(0.0f, 0.0f); // Start the selection at (0,0) curSelection = new Vector2(0.0f, 0.0f); // Grab the team object components teamBuyList = FindObjectOfType <PurchaseList>(); teamTeamSpawnerSpawner = FindObjectOfType <TeamSpawner> (); // Find the radial buttons GetChildButtons(); // Hide the cursor when we open Cursor.visible = false; // Grab the current position of the mouse oldMousePos = Input.mousePosition; // Slowdown the game speed oldTimeScale = Time.timeScale; Time.timeScale = slowdownFactor; }
protected void Page_Load(object sender, EventArgs e) { //顾客购买统计 var _db = new WingtipToys.Models.ProductContext(); List <OrderDetail> orderList = _db.OrderDetails.ToList(); PurchaseList.DataSource = orderList; PurchaseList.DataBind(); //销售统计 AdminOperation admin = new AdminOperation(); List <Product> list = admin.GetAllProduct(); ProductsList.DataSource = list; ProductsList.DataBind(); int sumNum = 0; double sumMoeny = 0; foreach (Product p in list) { sumNum += p.Sold; sumMoeny += (double)p.Sold * (double)p.UnitPrice; } SumNumber.Text = "书籍销售总数:" + sumNum.ToString(); SumMoney.Text = "书籍销售总金额:" + sumMoeny.ToString(); }
private void PurchaseDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { if (string.IsNullOrEmpty(NewPurchase[0].Crypto) || NewPurchase[0].CryptoQty <= 0 || NewPurchase[0].InvestedQty <= 0) { args.Cancel = true; new MessageDialog("Error.").ShowAsync(); } else { if (sender.PrimaryButtonText == "Add") { // Get logo for the coin var crypto = NewPurchase[0].Crypto; string logoURL = "Assets/Icons/icon" + crypto + ".png"; if (!File.Exists(logoURL)) { NewPurchase[0].CryptoLogo = "https://chasing-coins.com/coin/logo/" + crypto; } else { NewPurchase[0].CryptoLogo = "/" + logoURL; } PurchaseList.Add(NewPurchase[0]); } else if (sender.PrimaryButtonText == "Save") { PurchaseList.RemoveAt(EditingPurchaseId); PurchaseList.Insert(EditingPurchaseId, NewPurchase[0]); } // Update and save UpdatePortfolio(); SavePortfolio(); } }
private void purchaseInsert_Click(object sender, EventArgs e) { try { DbAccessor accessor = DbAccessor.Instance; Product product = accessor.GetProductByName(productListBox.SelectedItem.ToString()); Supplier supplier = accessor.GetSupplierByName(supplierListBox.SelectedItem.ToString()); PurchaseList purchase_list = new PurchaseList { price = Double.Parse(purchasePrice.Text), quantity = Int32.Parse(purchaseQuantity.Text), product_id = product.id, supplier_id = supplier.id }; accessor.CreatePurchaseList(purchase_list); MessageBox.Show("添加成功"); } catch (FormatException) { MessageBox.Show("输入的字段格式有误"); } catch (NullReferenceException) { MessageBox.Show("还没选择对象"); } }
/*public PurchaseSummary(string isbn, string customerId, int bookquantity, float price, string date, string cashier) * { * InitializeComponent(); * this.isbn = isbn; * this.customerId = customerId; * this.bookquantity = bookquantity; * this.price = price; * this.date = date; * this.cashier = cashier; * //totalPrice = bookquantity * price; * }*/ public PurchaseSummary(List <PurchaseList> purchaseList, PurchaseList order) { InitializeComponent(); summaryListView.ItemsSource = purchaseList; customerNameTxt.Content = order.CustomerName; cashierTxt.Content = order.Cashier; totalPriceTxt.Content = order.TotalPrice.ToString(); }
public override global::System.Data.DataSet Clone() { PurchaseList cln = ((PurchaseList)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
private void Set_PurchaseList() { List <Bomb> BombList_temp = SaveData.savedata.BombList; foreach (Bomb Item in BombList_temp) { var temp = new PurchaseList(); _PurchaseList.Add(temp); } }
private void RemovePortfolio_Click(object sender, RoutedEventArgs e) { var menu = sender as MenuFlyoutItem; var item = menu.DataContext as PurchaseClass; var items = DataGridd.ItemsSource.Cast <PurchaseClass>().ToList(); var index = items.IndexOf(item); PurchaseList.RemoveAt(index); UpdatePortfolio(); SavePortfolio(); }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { PurchaseList ds = new PurchaseList(); global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny(); any.Namespace = ds.Namespace; sequence.Items.Add(any); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte()));) { ; } if ((s1.Position == s1.Length)) { return(type); } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return(type); }
// Use this for initialization void Start() { // Grab the Camera for the scene, the first one is the one we want mainCam = Camera.main; // Grab the TeamSpawner component off of the TeamGameObject playersSpawner = playersTeamObject.GetComponent <TeamSpawner>(); // Grab the PurchaseList off of the TeamGameObject playersAvailableUnits = playersTeamObject.GetComponent <PurchaseList>(); theCanvas = FindObjectOfType <Canvas> (); }
private void EditPurchase_Click(object sender, RoutedEventArgs e) { var purchase = ((PurchaseClass)((FrameworkElement)sender).DataContext); EditingPurchaseId = PurchaseList.IndexOf(purchase); NewPurchase = new ObservableCollection <PurchaseClass>() { purchase }; TestRepeater.ItemsSource = NewPurchase; PurchaseDialog.Title = "💵 Edit purchase"; PurchaseDialog.PrimaryButtonText = "Save"; PurchaseDialog.ShowAsync(); }
private void DateRangeExpense() { DateTime sdate = Convert.ToDateTime(dtpStartDate.Text); DateTime edate = Convert.ToDateTime(dtpEndDate.Text); List <PurchaseList> list = new List <PurchaseList>(); PharmacyDbContext db = new PharmacyDbContext(); int rowNo = 1; var data = db.PurchaseSub .Where(a => a.CreatedDate >= sdate && a.CreatedDate <= edate) .ToList() .Select(x => new { SL = rowNo++, x.MedicinId, x.Quantity, x.UnitPrice, x.Total, Date = x.CreatedDate.ToString("d") }).ToList(); foreach (var item in data) { PurchaseList l = new PurchaseList { SL = item.SL.ToString(), MedicineName = GetMedicineName(item.MedicinId), Quantity = item.Quantity, UnitPrice = item.UnitPrice, Total = item.Total, Date = item.Date }; list.Add(l); } lblDueTotal.Text = db.PurchaseSub .ToList() .Where(a => a.CreatedDate >= sdate && a.CreatedDate <= edate) .Sum(x => x.Total).ToString(); // db.Voucher.Where(a => a.GLCode == GLCode.AccountReceivable && a.CustomerId != null).ToList().Sum(x => x.Dr-x.Cr).ToString(); // db.Voucher.Where(a => a.GLCode == GLCode.SaleMedicine && a.CustomerId != null).ToList().Sum(x => x.Cr).ToString(); db.Dispose(); dgvExpense.Columns.Clear(); dgvExpense.DataSource = list; MakeFullWidthScreen(); }
public static FractalLog ListToFractalLog(PurchaseList list) { Assert.IsNotNull(list); var log = new FractalLog(); log.Fractals = new List <Fractal>(); Assert.IsNotNull(log, "Log is NULL"); Assert.IsNotNull(log.Fractals, "Log.Fractals is null"); for (var i = 0; i < list.Count; i++) { Assert.IsNotNull(FractalLog.GetElementBySku(AppSession.DownloadedFractals, list[i].Sku), "FractalLog.GetElementBySku(AppSession.DownloadedFractals, list[i].Sku) != null"); Assert.IsNotNull(""); log.Fractals.Add(new Fractal { Name = FractalLog.GetElementBySku(AppSession.DownloadedFractals, list[i].Sku).Name, Sku = list[i].Sku, Type = 1 }); } return(log); }
public MainPage() { list = new PurchaseList(); //Сохранение объектов в память using (MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes((string)App.Current.Properties["purchases"]))) { var formatter = new DataContractJsonSerializer(typeof(PurchaseList)); list = (PurchaseList)formatter.ReadObject(ms); } Title = "Покупки"; Content = new StackLayout { VerticalOptions = LayoutOptions.FillAndExpand, Children = { list, ScanButton } }; ScanButton.Clicked += Scan; }
public static void WriteFile(string fileName, PurchaseList purcList) { string firstLine = "Время покупки: " + DateTime.Now.ToString(StringConstant.DateParseFormat); string secondLine = String.Format( "{0,-30}{1,-10}{2,-10}{3,-10}", "Наименование", "Цена", "Кол-во", "Сумма"); string lastLine = String.Format( "{0,-50}{1,-10}", "Итого:", purcList.FormattedCheckSum); using (TextWriter writer = new StreamWriter(fileName)) { writer.WriteLine(firstLine); writer.WriteLine(secondLine); foreach (Purchase purchase in purcList) { writer.WriteLine(purchase.ToString()); } writer.WriteLine(lastLine); } }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); PurchaseList ds = new PurchaseList(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "PurchaseListDtDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte()));) { ; } if ((s1.Position == s1.Length)) { return(type); } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return(type); }
internal void AddCurrentPurchaseEntry() { PurchaseList.Insert(0, _currPurchaseEntry); CurretPurchaseEntry = new CatalyticConverterManagement.PurchaseEntry(); }
private PurchaseList GetPurchaseList(SearchObject input) { PurchaseList result = new PurchaseList(); try { Expression <Func <Purchase, object> >[] exp = new Expression <Func <Purchase, object> >[] { x => x.PurchasePayments, x => x.PurchaseDetails, x => x.Suplier }; var predicate = PredicateBuilder.True <Purchase>(); predicate = predicate.And(x => !x.IsDeleted); if (input.PurchaseIds != null && input.PurchaseIds.Count > 0) { predicate = predicate.And(x => input.SaleIds.Contains(x.Id)); } else { if (input.FromDate != null) { predicate = predicate.And(x => x.PurchaseDate.Date >= input.FromDate.Date); } if (input.ToDate != null) { predicate = predicate.And(x => x.PurchaseDate.Date <= input.ToDate.Date); } } if (!string.IsNullOrWhiteSpace(input.BillIds)) { var billIds = input.BillIds.Split(',').ToList().ConvertAll(c => c.ToUpper().Trim()); predicate = predicate.And(x => billIds.Contains(x.PurchaseId.ToUpper().Trim())); } result.Purchases = _purchaseOpp.GetAllUsingExpression(out int totalCount, 1, 0, predicate, null, null, exp).OrderByDescending(x => x.PurchaseDate).ToList(); var predicateProd = PredicateBuilder.True <InventoryItem>(); predicateProd = predicateProd.And(x => !x.IsDeleted); var itemList = _itemOpp.GetAllUsingExpression(out int total, 1, 0, predicateProd).ToList(); //nullifying to avoid object chain if (result.Purchases != null) { result.Purchases.ForEach(x => { if (x.PurchaseDetails != null) { x.PurchaseDetails.ForEach(y => { y.Purchase = null; y.Item = itemList.Where(p => p.Id == y.Fk_InventoryItemId).FirstOrDefault(); }); } if (x.PurchasePayments != null) { x.PurchasePayments.ForEach(y => { y.Purchase = null; x.TotalPaid = x.TotalPaid + y.Amount; }); } if (x.Suplier != null) { x.Suplier.Purchases = null; } x.Due = Math.Round(x.RoundOffTotal - x.TotalPaid, 2); }); } } catch (Exception ex) { } return(result); }
public IActionResult GetPurchaseListOnExcel([FromQuery] string searchObject) { dynamic ret = null; try { SearchObject input = JsonConvert.DeserializeObject <SearchObject>(searchObject); PurchaseList result = GetPurchaseList(input); MemoryStream memoryStream = new MemoryStream(); using (SpreadsheetDocument document = SpreadsheetDocument.Create(memoryStream, SpreadsheetDocumentType.Workbook)) { WorkbookPart workbookPart = document.AddWorkbookPart(); workbookPart.Workbook = new Workbook(); WorksheetPart worksheetPart = workbookPart.AddNewPart <WorksheetPart>(); worksheetPart.Worksheet = new Worksheet(); Sheets sheets = workbookPart.Workbook.AppendChild(new Sheets()); Sheet sheet = new Sheet() { Id = workbookPart.GetIdOfPart(worksheetPart), SheetId = 1, Name = "Report" }; sheets.Append(sheet); workbookPart.Workbook.Save(); SheetData sheetData = worksheetPart.Worksheet.AppendChild(new SheetData()); // Constructing header DocumentFormat.OpenXml.Spreadsheet.Row row = new DocumentFormat.OpenXml.Spreadsheet.Row(); row.Append( ConstructCell("From", CellValues.String), ConstructCell(input.FromDate.ToString("dd/MM/yyyy"), CellValues.String), ConstructCell("To", CellValues.String), ConstructCell(input.ToDate.ToString("dd/MM/yyyy"), CellValues.String)); sheetData.AppendChild(row); sheetData.AppendChild(new DocumentFormat.OpenXml.Spreadsheet.Row()); DocumentFormat.OpenXml.Spreadsheet.Row heading = new DocumentFormat.OpenXml.Spreadsheet.Row(); heading.Append( ConstructCell("BillNo", CellValues.String), ConstructCell("Customer", CellValues.String), ConstructCell("Amount (Rs)", CellValues.String), ConstructCell("Date(DD/MM/YYYY)", CellValues.String)); // Insert the header row to the Sheet Data sheetData.AppendChild(heading); // Inserting each employee foreach (var each in result.Purchases) { row = new DocumentFormat.OpenXml.Spreadsheet.Row(); row.Append( ConstructCell(each.PurchaseId, CellValues.Number), //ConstructCell(each.Customer.Name, CellValues.String), ConstructCell(each.FinalTotal.ToString(), CellValues.Number), ConstructCell(each.PurchaseDate.ToString("dd/MM/yyyy"), CellValues.String)); sheetData.AppendChild(row); } worksheetPart.Worksheet.Save(); } memoryStream.Position = 0; ret = new FileStreamResult(memoryStream, "application/octet-stream"); } catch (Exception ex) { } return(ret); }
public JsonResult GetPurderOrderList(string status) { if (status == "" || status == null) { status = "open"; } IEnumerable <MvcPurchaseModel> PurchaseList; try { var draw = Request.Form.GetValues("draw").FirstOrDefault(); var start = Request.Form.GetValues("start").FirstOrDefault(); var length = Request.Form.GetValues("length").FirstOrDefault(); var sortColumn = Request.Form.GetValues("columns[" + Request.Form.GetValues("order[0][column]").FirstOrDefault() + "][name]").FirstOrDefault(); var sortColumnDir = Request.Form.GetValues("order[0][dir]").FirstOrDefault(); string search = Request.Form.GetValues("search[value]")[0]; int pageSize = length != null?Convert.ToInt32(length) : 0; int skip = start != null?Convert.ToInt32(start) : 0; int CompanyId = Convert.ToInt32(Session["CompayID"]); GlobalVeriables.WebApiClient.DefaultRequestHeaders.Add("CompayID", CompanyId.ToString()); HttpResponseMessage response = GlobalVeriables.WebApiClient.GetAsync("OrderListByStatus/" + status).Result; PurchaseList = response.Content.ReadAsAsync <IEnumerable <MvcPurchaseModel> >().Result; if (!string.IsNullOrEmpty(search) && !string.IsNullOrWhiteSpace(search)) { PurchaseList = PurchaseList.Where(p => p.PurchaseOrderID.ToString().Contains(search) || p.PurchaseRefNumber != null && p.PurchaseRefNumber.ToLower().Contains(search.ToLower()) || p.PurchaseDate != null && p.PurchaseDate.ToString().ToLower().Contains(search.ToLower()) || p.PurchaseDueDate != null && p.PurchaseDueDate.ToString().ToLower().Contains(search.ToLower()) || p.Status != null && p.Status.ToString().ToLower().Contains(search.ToLower()) || p.PurchaseTotoalAmount != null && p.PurchaseTotoalAmount.ToString().ToLower().Contains(search.ToLower()) || p.Status != null && p.Status.ToString().ToLower().Contains(search.ToLower())).ToList(); } // switch (sortColumn) //{ // case "ContactName": // ContactsList = ContactsList.OrderBy(c => c.ContactName); // break; // case "Type": // ContactsList = ContactsList.OrderBy(c => c.Type); // break; // case "BillingPersonName": // ContactsList = ContactsList.OrderBy(c => c.BillingPersonName); // break; // case "BillingCompanyName": // ContactsList = ContactsList.OrderBy(c => c.BillingCompanyName); // break; // case "BillingVatTRN": // ContactsList = ContactsList.OrderBy(c => c.BillingVatTRN); // break; // default: // ContactsList = ContactsList.OrderByDescending(c => c.ContactsId); // break; //} int recordsTotal = recordsTotal = PurchaseList.Count(); var data = PurchaseList.Skip(skip).Take(pageSize).ToList(); return(Json(new { draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data = data }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { Response.Write(ex.ToString()); Json(new { draw = 0, recordsFiltered = 0, recordsTotal = 0, data = 0 }, JsonRequestBehavior.AllowGet); } return(Json(null, JsonRequestBehavior.AllowGet)); }