public ActionResult Create()
        {
            var paypalapiList = this.ImsService.GetPaypalApiList(new PaypalApiRequest {
                IsActive = true
            });

            this.ViewBag.PaypalApiID = new SelectList(paypalapiList, "ID", "PPAccount");

            var productlist = this.ImsService.GetProductList();

            this.ViewBag.ProductID = new SelectList(productlist, "ID", "Sku");


            var query = from d in this.ImsService.DistinctPaymentItemInfo()
                        group new { d.Name, d.Number } by d.Number into ItemGp
            select ItemGp.FirstOrDefault();

            this.ViewBag.ItemNumber = new SelectList(query, "Number", "Name");


            this.ViewBag.SellingPlace = new SelectList(this.ImsService.GetCountryNameAndCode(), "ShipToCountryCode", "ShipToCountryName");
            this.ViewBag.StorePlace   = new SelectList(this.ImsService.GetCountryNameAndCode(), "ShipToCountryCode", "ShipToCountryName");
            var model = new Association();

            return(View("Edit", model));
        }
        public ActionResult Edit(int id)
        {
            var model = this.ImsService.GetAssociation(id);

            var paypalapiList = this.ImsService.GetPaypalApiList();

            this.ViewBag.PaypalApiID = new SelectList(paypalapiList, "ID", "PPAccount", model.PaypalApiID);

            var productlist = this.ImsService.GetProductList();

            this.ViewBag.ProductID = new SelectList(productlist, "ID", "Sku", model.ProductID);


            //var query = from d in this.ImsService.DistinctTransactionItem()
            //            group new { d.ItemTitle } by d.ItemTitle into ItemGp
            //            select ItemGp.FirstOrDefault();
            //this.ViewBag.ItemTitle = new SelectList(query, "ItemTitle", "ItemTitle", model.ItemTitle);
            var query = from d in this.ImsService.DistinctPaymentItemInfo()
                        group new { d.Name, d.Number } by d.Number into ItemGp
            select ItemGp.FirstOrDefault();

            this.ViewBag.ItemNumber = new SelectList(query, "Number", "Name", model.ItemNumber);

            this.ViewBag.SellingPlace = new SelectList(this.ImsService.GetCountryNameAndCode(), "ShipToCountryCode", "ShipToCountryName", model.SellingPlace);
            this.ViewBag.StorePlace   = new SelectList(this.ImsService.GetCountryNameAndCode(), "ShipToCountryCode", "ShipToCountryName", model.StorePlace);


            return(View(model));
        }
        public ActionResult Create()
        {
            var paypalapiList = this.ImsService.GetPaypalApiList();

            this.ViewBag.PaypalApiID = new SelectList(paypalapiList, "ID", "PPAccount");

            var productlist = this.ImsService.GetProductList();

            this.ViewBag.ProductID = new SelectList(productlist, "ID", "Sku");


            var query = from d in this.ImsService.DistinctTransactionItem()
                        group new { d.ItemTitle } by d.ItemTitle into ItemGp
            select ItemGp.FirstOrDefault();

            this.ViewBag.ItemTitle = new SelectList(query, "ItemTitle", "ItemTitle");


            this.ViewBag.SellingPlace = new SelectList(this.ImsService.GetCountryNameAndCode(), "ShipToCountryCode", "ShipToCountryName");
            this.ViewBag.StorePlace   = new SelectList(this.ImsService.GetCountryNameAndCode(), "ShipToCountryCode", "ShipToCountryName");
            var model = new Association();

            return(View("Edit", model));
        }