コード例 #1
0
        protected void GoButton_Click(object sender, EventArgs e)
        {
            bool selectAll = AlwaysConvert.ToBool(SelectAll.Value, false);
            bool link      = AlwaysConvert.ToBool(GridActions.SelectedValue, false);

            if (selectAll)
            {
                BitFieldState   featured = (BitFieldState)Enum.Parse(typeof(BitFieldState), FeaturedFilter.SelectedValue);
                IList <Product> products = ProductDataSource.FindProducts(Name.Text.Trim(), SearchDescriptions.Checked, Sku.Text.Trim(), AlwaysConvert.ToInt(CategoriesList.SelectedValue), AlwaysConvert.ToInt(ManufacturerList.SelectedValue), AlwaysConvert.ToInt(VendorList.SelectedValue), featured, AlwaysConvert.ToInt(TaxCodeList.SelectedValue), AlwaysConvert.ToDecimal(FromPrice.Text), AlwaysConvert.ToDecimal(ToPrice.Text), OnlyDigitalGoods.Checked, OnlyGiftCertificates.Checked, OnlyKits.Checked, OnlySubscriptions.Checked, AlwaysConvert.ToInt(ProductGroups.SelectedValue));
                foreach (var product in products)
                {
                    SetFeatured(product.Id, link);
                }
            }
            else
            {
                int indexPeg = PG.PageSize * PG.PageIndex;

                foreach (GridViewRow row in PG.Rows)
                {
                    CheckBox selected = (CheckBox)PageHelper.RecursiveFindControl(row, "PID");
                    if ((selected != null) && selected.Checked)
                    {
                        int productId = (int)PG.DataKeys[row.DataItemIndex - indexPeg].Values[0];
                        SetFeatured(productId, link);
                    }
                }
            }

            PG.DataBind();
        }
コード例 #2
0
        public async Task <IActionResult> Upsert(int id)
        {
            Room room;
            var  claimsIdentity = (ClaimsIdentity)User.Identity;
            var  claim          = claimsIdentity.FindFirst(ClaimTypes.NameIdentifier);

            PG pg = await _unitOfWork.PG.GetAsync(claim.Value, IncludePriceTiers : true);

            IList <SelectListItem> tiers = pg.PriceTiers.Select(pt => new SelectListItem()
            {
                Text  = $"{pt.Name} (₹{String.Format("{0:n2}", pt.Rent)})",
                Value = pt.Id.ToString()
            }).ToList();

            ViewBag.Tiers  = tiers;
            ViewBag.Male   = pg.IsMale;
            ViewBag.Female = pg.IsFemale;

            if (id == 0)
            {
                room = new Room();
            }
            else
            {
                room = await _unitOfWork.Room.GetAsync(id);
            }

            return(View(room));
        }
コード例 #3
0
        public async Task <ActionResult <PG> > PostPG(PG pG)
        {
            // Do something with the product (not shown).
            _context.PG.Add(pG);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetPG", new { id = pG.Id }, pG));
        }
コード例 #4
0
        public (PG onPF, PG onPB, PG face, PG back) SplitPolygon(PG p)
        {
            var l     = p.verts.Length;
            var pType = 0;
            var vType = new int[l];

            for (var i = 0; i < l; i++)
            {
                var t = GetType(p.verts[i]);
                pType   |= t;
                vType[i] = t;
            }

            switch (pType)
            {
            default: throw new System.Exception();

            case 0: return((dot(n, p.plane.n) > 0) ? (p, null, null, null) : (null, p, null, null));

            case 1: return(null, null, p, null);

            case 2: return(null, null, null, p);

            case 3:
                var faces = new List <d3>();
                var backs = new List <d3>();
                for (var i = 0; i < l; i++)
                {
                    var j  = (i + 1) % l;
                    var si = vType[i];
                    var sj = vType[j];
                    var vi = p.verts[i];
                    var vj = p.verts[j];

                    if (si == FACE)
                    {
                        faces.Add(vi);
                    }
                    else if (si == BACK)
                    {
                        backs.Add(vi);
                    }
                    else
                    {
                        faces.Add(vi); backs.Add(vi);
                    }

                    if ((si | sj) == SPAN)
                    {
                        var t = (w - dot(n, vi)) / dot(n, vj - vi);
                        var v = lerp(vi, vj, t);
                        faces.Add(v);
                        backs.Add(v);
                    }
                }
                return(null, null, new PG(faces.ToArray()), new PG(backs.ToArray()));
            }
        }
コード例 #5
0
        public ActionResult EditPG(int id)
        {
            PG pg = db.PGs.Find(id);

            if (pg == null)
            {
                return(HttpNotFound());
            }
            return(View(pg));
        }
コード例 #6
0
        public void Add()
        {
            var newItem = new PG
            {
                Id     = 3,
                PGTest = "tuttoVaBene"
            };

            PGContext.PGs.Add(newItem);
            PGContext.SaveChanges();
        }
コード例 #7
0
        public async Task <IActionResult> Upsert(Room room)
        {
            var claimsIdentity = (ClaimsIdentity)User.Identity;
            var claim          = claimsIdentity.FindFirst(ClaimTypes.NameIdentifier);

            PG pg = await _unitOfWork.PG.GetAsync(claim.Value, IncludePriceTiers : true);

            if (ModelState.IsValid)
            {
                if (pg.PriceTiers.Any(pt => pt.Id == room.PriceTierId))
                {
                    if (room.Id == 0)
                    {
                        room.PGId = pg.Id;
                        await _unitOfWork.Room.AddAsync(room);
                    }
                    else
                    {
                        await _unitOfWork.Room.UpdateAsync(room);
                    }
                    _unitOfWork.Save();
                }
                else
                {
                    IList <SelectListItem> tiers = pg.PriceTiers.Select(pt => new SelectListItem()
                    {
                        Text  = $"{pt.Name} (₹{String.Format("{0:n2}", pt.Rent)})",
                        Value = pt.Id.ToString()
                    }).ToList();

                    ViewBag.Tiers  = tiers;
                    ViewBag.Male   = pg.IsMale;
                    ViewBag.Female = pg.IsFemale;

                    return(View(room));
                }
            }
            else
            {
                IList <SelectListItem> tiers = pg.PriceTiers.Select(pt => new SelectListItem()
                {
                    Text  = $"{pt.Name} (₹{String.Format("{0:n2}", pt.Rent)})",
                    Value = pt.Id.ToString()
                }).ToList();

                ViewBag.Tiers  = tiers;
                ViewBag.Male   = pg.IsMale;
                ViewBag.Female = pg.IsFemale;

                return(View(room));
            }

            return(RedirectToAction(nameof(Index)));
        }
コード例 #8
0
        public static PG[] Clone(PG[] src)
        {
            var l = src.Length;
            var d = new PG[l];

            for (var i = 0; i < l; i++)
            {
                d[i] = new PG(src[i]);
            }
            return(d);
        }
コード例 #9
0
        private Navigator CreateNavigator(Models.MasterData masters)
        {
            var model = new UnitModel(masters);
            var frame = MainFrame;

            return(new Navigator()
            {
                PG.Item("マイページ", () => default(object), vm => new Pages.MyPage.MyPageNavigator(frame)).WithoutHistory(),
                PG.Item("強化合成", () => new ViewModels.UnionPageModel(masters, model), vm => new Pages.UnitEnhancement.UnitEnhancementNavigator(frame, vm)),
                PG.Item("ガチャ", () => new ViewModels.GachaPageModel(masters, model), vm => new Pages.Gacha.GachaNavigator(frame, vm)),
                PG.Item("売却", () => new ViewModels.UnitSellingPageModel(masters, model), vm => new Pages.UnitSelling.UnitSellingNavigator(frame, vm)),
            });
        }
コード例 #10
0
        public async Task <IActionResult> Index()
        {
            var claimsIdentity = (ClaimsIdentity)User.Identity;
            var claim          = claimsIdentity.FindFirst(ClaimTypes.NameIdentifier);

            PG pg = await _unitOfWork.PG.GetAsync(claim.Value);

            var requests = await _unitOfWork.PGRequest.GetAllAsync(req => req.PGId == pg.Id && req.RequestStatus == RequestStatus.Pending,
                                                                   includeProperties : "Applicant,PriceTier",
                                                                   orderBy : x => x.OrderByDescending(req => req.Date));

            return(View(requests));
        }
コード例 #11
0
        public void AddUser(ulong client)
        {
            // Договариваемся, кто генерирует p и g.
            using SimpleWriterReader wr = new SimpleWriterReader(server, TimeoutConnection);
            byte              arrangement;
            Memory <byte>     buffer;
            BigInteger        a;
            Task <BigInteger> a_task = Task.Run(() => Generator.GenerateRandomPrime(CountPrimeBits / 4));

            do
            {
                arrangement = (byte)ran.Next(byte.MinValue, byte.MaxValue); // Договорённость.
                wr.Write(client, new Memory <byte>(new byte[] { arrangement }));
                buffer = wr.Read(client);
                if (buffer.Length > 1)
                {
                    throw new Exception("Не совпадает протокол. " + string.Join(", ", buffer));
                }
            } while (arrangement == buffer.Span[0]);
            BigInteger p;
            BigInteger g = -2;

            if (arrangement > buffer.Span[0])
            {
                sw.Start();
                PG pg = TakePrepared();
                sw.Stop();
                server.DebugInfo($"GenerateRandomPrime and AntiderivativeRootModulo: {sw.Elapsed}.");
                sw.Reset();
                p = pg.P;
                g = pg.G;
                wr.Write(client, p.ToByteArray());
                wr.Write(client, g.ToByteArray());
            }
            else
            {
                p = new BigInteger(wr.Read(client).ToArray());
                g = new BigInteger(wr.Read(client).ToArray());
            }
            a_task.Wait();
            a = a_task.Result;
            BigInteger A = BigInteger.ModPow(g, a, p);

            wr.Write(client, A.ToByteArray());
            BigInteger B = new BigInteger(wr.Read(client).ToArray());
            BigInteger K = BigInteger.ModPow(B, a, p);

            users[client] = new Memory <byte>(K.ToByteArray());
        }
コード例 #12
0
        protected void GoButton_Click(object sender, EventArgs e)
        {
            bool selectAll = AlwaysConvert.ToBool(SelectAll.Value, false);
            bool link      = AlwaysConvert.ToBool(GridActions.SelectedValue, false);

            if (selectAll)
            {
                BitFieldState featured = OnlyFeatured.Checked ? BitFieldState.True : BitFieldState.Any;
                BitFieldState status   = (BitFieldState)Enum.Parse(typeof(BitFieldState), ProductAssignment.SelectedValue);

                int categoryId = 0;
                if (!_DisplayCategorySearch)
                {
                    categoryId = AlwaysConvert.ToInt(CategoriesList.SelectedValue);
                }
                else
                {
                    categoryId = AlwaysConvert.ToInt(HiddenSelectedCategoryId.Value);
                }

                IList <Product> products = ProductDataSource.FindProducts(Name.Text.Trim(), SearchDescriptions.Checked, Sku.Text.Trim(), categoryId, AlwaysConvert.ToInt(ManufacturerList.SelectedValue), AlwaysConvert.ToInt(VendorList.SelectedValue), featured, AlwaysConvert.ToInt(TaxCodeList.SelectedValue), AlwaysConvert.ToDecimal(FromPrice.Text), AlwaysConvert.ToDecimal(ToPrice.Text), OnlyDigitalGoods.Checked, OnlyGiftCertificates.Checked, OnlyKits.Checked, OnlySubscriptions.Checked, AlwaysConvert.ToInt(ProductGroups.SelectedValue), AssignmentTable, AssignmentValue, status);
                foreach (var product in products)
                {
                    if (OnAssignProduct != null)
                    {
                        OnAssignProduct(this, new FindAssignProductEventArgs(product.Id, link));
                    }
                }
            }
            else
            {
                int indexPeg = PG.PageSize * PG.PageIndex;

                foreach (GridViewRow row in PG.Rows)
                {
                    CheckBox selected = (CheckBox)PageHelper.RecursiveFindControl(row, "PID");
                    if ((selected != null) && selected.Checked)
                    {
                        int productId = (int)PG.DataKeys[row.DataItemIndex - indexPeg].Values[0];
                        if (OnAssignProduct != null)
                        {
                            OnAssignProduct(this, new FindAssignProductEventArgs(productId, link));
                        }
                    }
                }
            }

            PG.DataBind();
        }
コード例 #13
0
        protected void DeleteButton_Click(object sender, EventArgs e)
        {
            List <object> values = PG.GetSelectedDataKeyValues();

            if (values.Count > 0)
            {
                List <int> productIds = values.ConvertAll <int>(delegate(object value) { return(Convert.ToInt32(value)); });
                foreach (int productId in productIds)
                {
                    ProductDataSource.Delete(productId);
                }
            }

            PG.DataBind();
        }
コード例 #14
0
    public bool PlacementGridCheck()
    {
        foreach (GameObject PG in PlacementGrids)
        {
            Collider testCollider = PG.GetComponent <Collider>();

            if (testCollider.bounds.Contains(m_cCollider.bounds.min) && testCollider.bounds.Contains(m_cCollider.bounds.max))
            {
                return(true);
            }
        }

        //make invis
        return(false);
    }
コード例 #15
0
        public async Task <IActionResult> Index()
        {
            PG  pg;
            var claimsIdentity = (ClaimsIdentity)User.Identity;
            var claim          = claimsIdentity.FindFirst(ClaimTypes.NameIdentifier);

            pg = await _unitOfWork.PG.GetAsync(claim.Value, true, true, false);

            if (pg == null)
            {
                pg = new PG();
            }

            return(View(pg));
        }
コード例 #16
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            gridFooter.Visible = PG.Visible && PG.Rows.Count > 0;

            if (!Page.IsPostBack && gridFooter.Visible)
            {
                ProductAssignment.ClearSelection();
                ListItem item = ProductAssignment.Items.FindByValue(AssignmentStatus);
                if (item != null)
                {
                    item.Selected = true;
                }
                PG.DataBind();
            }
        }
コード例 #17
0
 public ActionResult Delete(PG pg)
 {
     try
     {
         // TODO: Add delete logic here
         pg = db.PGs.Find(pg.id);
         db.PGs.Remove(pg);
         db.SaveChanges();
         return(RedirectToAction("WelcomeAdmin", "Login"));
     }
     catch
     {
         return(View("WelcomeAdmin", "Login"));
     }
 }
コード例 #18
0
        public ActionResult RegisterPG(PG pg)
        {
            //pg.photo = new byte[File1.ContentLength]; // file1 to store image in binary formate

            //File1.InputStream.Read(pg.photo, 0, File1.ContentLength);

            // pg.CategoryName = "~content/PG_img/" + pg.CategoryName.FileName;


            // pg.CategoryName = new byte[image1.ContentLength];

            //string fileName = Path.GetFileNameWithoutExtension(pg.file.FileName);

            //string extension = Path.GetExtension(pg.file.FileName);
            //fileName = fileName + DateTime.Now.ToString("yymmssfff") + extension;
            //pg.Status = "~/Image/" + fileName;
            //fileName = Path.Combine(Server.MapPath("~/Image/"), fileName);
            //pg.file.SaveAs(fileName);

            //var path = "";
            //if (File1 != null)
            //{
            //    if (File1.ContentLength > 0)
            //    {
            //        if (Path.GetExtension(File1.FileName).ToLower() == ".jpg"
            //            || Path.GetExtension(File1.FileName).ToLower() == ".png"
            //            || Path.GetExtension(File1.FileName).ToLower() == ".gif"
            //            || Path.GetExtension(File1.FileName).ToLower() == ".jpeg")
            //        {

            //            path = Path.Combine(Server.MapPath("~/Image/"), File1.FileName);
            //            File1.SaveAs(path);
            //            ViewBag.UploadSuccess = true;
            //        }
            //    }

            // pg.photo = "~/Image/";
            ////}


            if (ModelState.IsValid)
            {
                db.PGs.Add(pg);
                db.SaveChanges();
            }
            //ModelState.Clear();
            return(RedirectToAction("Login", "Login"));
        }
コード例 #19
0
 protected void PG_DataBound(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (PG.Rows.Count == 0)
         {
             ProductAssignment.ClearSelection();
             ListItem item = ProductAssignment.Items.FindByValue("Any");
             if (item != null)
             {
                 item.Selected = true;
             }
             PG.DataBind();
         }
     }
 }
コード例 #20
0
        protected void RemoveButton_Click(object sender, EventArgs e)
        {
            ImageButton removeButton  = (ImageButton)sender;
            int         dataItemIndex = AlwaysConvert.ToInt(removeButton.CommandArgument);
            GridView    grid          = PG;
            int         productId     = (int)grid.DataKeys[dataItemIndex].Value;

            SetFeatured(productId, false);
            ImageButton attachButton = removeButton.Parent.FindControl("AttachButton") as ImageButton;

            if (attachButton != null)
            {
                attachButton.Visible = true;
            }
            removeButton.Visible = false;
            PG.DataBind();
        }
コード例 #21
0
        public ActionResult EditPG(PG adm)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    db.Entry(adm).State = EntityState.Modified;
                    db.SaveChanges();
                }

                return(RedirectToAction("Login", "Login"));
            }
            catch
            {
                return(View("Login", "Login"));
            }
        }
コード例 #22
0
        public async Task <IActionResult> Upsert([FromForm] PGEditViewModel pgVM)
        {
            PGEditViewModel pgEdit         = new PGEditViewModel();
            var             claimsIdentity = (ClaimsIdentity)User.Identity;
            var             claim          = claimsIdentity.FindFirst(ClaimTypes.NameIdentifier);

            PG pg = pgVM.PG;

            pg.ApplicationUserId = claim.Value;
            if (!pg.IsMale && !pg.IsFemale)
            {
                pg.IsMale = true;
            }

            await _unitOfWork.PG.Update(pg, pgVM.Facilities);

            return(RedirectToAction(nameof(Index)));
        }
コード例 #23
0
        public async Task <bool> Delete(int id)
        {
            var claimsIdentity = (ClaimsIdentity)User.Identity;
            var claim          = claimsIdentity.FindFirst(ClaimTypes.NameIdentifier);

            PG pg = await _unitOfWork.PG.GetAsync(claim.Value, IncludePriceTiers : true);

            if (pg.PriceTiers != null)
            {
                var priceTier = pg.PriceTiers.Where(pt => pt.Id == id).SingleOrDefault();
                if (priceTier != null)
                {
                    _unitOfWork.PriceTier.Remove(priceTier);
                    _unitOfWork.Save();
                }
            }

            return(true);
        }
コード例 #24
0
        protected void ProductsGrid_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
        {
            if (e.CommandName.StartsWith("Do_"))
            {
                int     productId = AlwaysConvert.ToInt(e.CommandArgument);
                Product product   = ProductDataSource.Load(productId);
                switch (e.CommandName)
                {
                case "Do_Copy":
                    int newProductId = CatalogDataSource.Copy(productId, CatalogNodeType.Product, 0);
                    Response.Redirect(string.Format("EditProduct.aspx?ProductId={0}", newProductId));
                    break;

                case "Do_Delete":
                    if (product != null)
                    {
                        product.Delete();
                    }
                    break;

                case "Do_Pub":
                    // TOGGLE VISIBILITY
                    switch (product.Visibility)
                    {
                    case CatalogVisibility.Public:
                        product.Visibility = CatalogVisibility.Hidden;
                        break;

                    case CatalogVisibility.Hidden:
                        product.Visibility = CatalogVisibility.Private;
                        break;

                    default:
                        product.Visibility = CatalogVisibility.Public;
                        break;
                    }
                    product.Save();
                    break;
                }
                PG.DataBind();
            }
        }
コード例 #25
0
        protected void AttachButton_Click(object sender, EventArgs e)
        {
            ImageButton attachButton  = (ImageButton)sender;
            int         dataItemIndex = AlwaysConvert.ToInt(attachButton.CommandArgument);
            GridView    grid          = PG;
            int         productId     = (int)grid.DataKeys[dataItemIndex].Value;

            if (OnAssignProduct != null)
            {
                OnAssignProduct(this, new FindAssignProductEventArgs(productId, true));
            }
            ImageButton removeButton = attachButton.Parent.FindControl("RemoveButton") as ImageButton;

            if (removeButton != null)
            {
                removeButton.Visible = true;
            }
            attachButton.Visible = false;
            PG.DataBind();
        }
コード例 #26
0
 protected void ResetButton_Click(object sender, EventArgs e)
 {
     Name.Text = string.Empty;
     SearchDescriptions.Checked = false;
     Sku.Text = string.Empty;
     CategoriesList.SelectedIndex = 0;
     FromPrice.Text = string.Empty;
     ToPrice.Text   = string.Empty;
     ManufacturerList.SelectedIndex = 0;
     VendorList.SelectedIndex       = 0;
     ProductGroups.SelectedIndex    = 0;
     TaxCodeList.SelectedIndex      = 0;
     OnlyDigitalGoods.Checked       = false;
     OnlyGiftCertificates.Checked   = false;
     OnlyKits.Checked              = false;
     OnlySubscriptions.Checked     = false;
     FeaturedFilter.SelectedIndex  = 1;
     ShowProductThumbnails.Checked = false;
     PG.DataBind();
 }
コード例 #27
0
        public void CheckEmail(PG pg)
        {
            if (ModelState.IsValid)
            {
                var details = (from userlist in db.PGs
                               where userlist.User_Name == pg.User_Name && userlist.Password == pg.Password
                               select new
                {
                    userlist.Email,
                    userlist.id,
                }).ToList();



                if (details.FirstOrDefault() != null)
                {
                    Session["id"]    = details.FirstOrDefault().id;
                    Session["Email"] = details.FirstOrDefault().Email;
                }
            }
        }
コード例 #28
0
 public bool readGroupConfig()
 {
     try
     {
         ProfileGroup PG;
         foreach (System.Collections.Generic.KeyValuePair <string, ProfileGroup> it in m_Groups)
         {
             PG = it.Value;
             PG.CreateBaseRules();
             if (PG.ReadConfig() == false)
             {
                 m_log.Log("Cannot read config for profilegroup " + PG.m_id);
                 return(false);
             }
         }
         return(true);
     }
     catch (Exception e)
     {
         m_log.Log("Exception in readConfig: ", e);
     }
     return(false);
 }
コード例 #29
0
ファイル: Program.cs プロジェクト: Shivaprasad143/LinqNew
        static void Main(string[] args)
        {
            List <Product>  product  = new List <Product>(5);
            List <Customer> customer = new List <Customer>(5);
            List <Order>    order    = new List <Order>(10);

            product.Add(new Product(1, "mobile", 100, 2));
            product.Add(new Product(2, "laptop", 200, 3));
            product.Add(new Product(3, "ipad", 100, 5));
            product.Add(new Product(4, "sunglass", 1000, 4));
            product.Add(new Product(5, "watch", 100, 1));

            customer.Add(new Customer(1, "shiva"));
            customer.Add(new Customer(2, "prasad"));
            customer.Add(new Customer(3, "kumar"));
            customer.Add(new Customer(4, "harsha"));
            customer.Add(new Customer(5, "niharika"));

            order.Add(new Order(1, Convert.ToDateTime("1/25/2017"), product[1], customer[0]));
            order.Add(new Order(2, Convert.ToDateTime("2/20/2016"), product[2], customer[1]));
            order.Add(new Order(3, Convert.ToDateTime("3/31/2016"), product[3], customer[4]));
            order.Add(new Order(4, Convert.ToDateTime("4/24/2016"), product[4], customer[1]));
            order.Add(new Order(5, Convert.ToDateTime("5/7/2016"), product[0], customer[2]));
            order.Add(new Order(6, Convert.ToDateTime("6/11/2016"), product[3], customer[3]));
            order.Add(new Order(7, Convert.ToDateTime("7/17/2016"), product[2], customer[0]));
            order.Add(new Order(8, Convert.ToDateTime("8/13/2017"), product[3], customer[3]));
            order.Add(new Order(9, Convert.ToDateTime("9/28/2017"), product[4], customer[2]));
            order.Add(new Order(10, Convert.ToDateTime("10/21/2016"), product[2], customer[1]));

            var ProductinStock = from value in product
                                 where value.UnitsInStock > 0 && value.Price > 100
                                 select value.Name;

            Console.WriteLine("Printing all product name in stock and Price greater than 100.: ");
            foreach (var p in ProductinStock)
            {
                Console.WriteLine(p);
            }

            var Value = from orders in order
                        group orders by orders.customer.ID into CG
                        select new
            {
                value = CG.Sum(o => o.product.Price),
                key   = CG.Key
            };

            Console.WriteLine("Heighest to lowest value spent by the 5 customers:");
            foreach (var i in Value)
            {
                Console.WriteLine(i);
            }



            DateTime date = DateTime.Now;

            var buy = from orders in order
                      where DateTime.Compare(orders.dateOrder, date.AddMonths(-1)) > 0
                      select orders.customer.name;


            Console.WriteLine("9.	Printing all customers who brought a product at least once in last month:");
            foreach (var b in buy)
            {
                Console.WriteLine(b);
            }


            var last = from orders in order
                       group orders by orders.product.ID into PG
                       select new
            {
                value = PG.Count(),
                key   = PG.Key
            };

            Console.WriteLine("Printing Names of the product with number of times it was bought!");
            foreach (var t in last)
            {
                Console.WriteLine(t);
            }

            Console.ReadLine();
        }
コード例 #30
0
 public DataTable HPrestamosGeneral(int agencia, DateTime f1, DateTime f2)
 {
     return(PG.GetDataHitoPrestamoGeneral(agencia, f1, f2));
 }