当前位置: 首页>>代码示例>>C#>>正文


C# Customer.Get方法代码示例

本文整理汇总了C#中Customer.Get方法的典型用法代码示例。如果您正苦于以下问题:C# Customer.Get方法的具体用法?C# Customer.Get怎么用?C# Customer.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Customer的用法示例。


在下文中一共展示了Customer.Get方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Index

        public async Task<ActionResult> Index() {
            HttpContext ctx = System.Web.HttpContext.Current;


            var pcats = CURTAPI.GetParentCategoriesAsync();
            await Task.WhenAll(new Task[] { pcats });

            ViewBag.parent_cats = await pcats;

            // Instantiate our Customer object
            Customer cust = new Customer();

            // Retrieve from Session/Cookie
            cust.GetFromStorage(ctx);

            if (!cust.LoggedIn(ctx)) {
                return RedirectToAction("Index","Authenticate");
            }

            // Get the Customer record
            cust.Get();

            cust.BindAddresses();

            ViewBag.countries = UDF.GetCountries();
            ViewBag.cust = cust;
            ViewBag.error = TempData["error"];
            return View();
        }
开发者ID:curt-labs,项目名称:CURTeCommerce,代码行数:29,代码来源:AccountController.cs

示例2: Save

        public dynamic Save(int id = 0, string email = "", string fname = "", string lname = "")
        {
            string error = "";
            try {
                Customer cust = new Customer { ID = id };
                cust.Get();
                cust.Update(email, fname, lname);

            } catch (Exception e) {
                error = e.Message;
            }

            return RedirectToAction("Info", "Customers", new { id = id });
        }
开发者ID:meganmcchesney,项目名称:CURTeCommerce,代码行数:14,代码来源:CustomersController.cs

示例3: Info

        public ActionResult Info(int id = 0)
        {
            try {
                if (id == 0) {
                    throw new Exception("Invalid reference to Customer");
                }
                Customer cust = new Customer {
                    ID = id
                };
                cust.Get();
                ViewBag.customer = cust;

                return View();
            } catch (Exception e) {
                TempData["error"] = e.Message;
                return RedirectToAction("Index");
            }
        }
开发者ID:meganmcchesney,项目名称:CURTeCommerce,代码行数:18,代码来源:CustomersController.cs

示例4: SendValidation

        public ActionResult SendValidation(int id = 0) {
            try {
                Customer cust = new Customer { ID = id };
                cust.Get();
                cust.SendValidation();

                TempData["error"] = "An e-mail has been sent to you with a validation link.";
            } catch (Exception) {
                TempData["error"] = "We're sorry, but we failed to send your validation e-mail.";
            }
            return RedirectToAction("Index");
        }
开发者ID:curt-labs,项目名称:CURTeCommerce,代码行数:12,代码来源:AuthenticateController.cs

示例5: CreatePurchaseOrder

        internal void CreatePurchaseOrder(int id = 0) {
                try {
                    Settings settings = new Settings();
                    Cart order = new Cart().Get(id);
                    Payment payment = order.getPayment();
                    if (order.CartItems.Count > 0) {
                        Customer cust = new Customer { ID = order.cust_id };
                        cust.Get();
                        order.BindAddresses();
                        string ponumber = settings.Get("EDIPOPreface") + order.payment_id.ToString();
                        CloudBlockBlob blob = null;
                        string edicontent = "";
                        int linecount = 1;
                        // linecount is just for the PO section and doesn't include the head or tail
                        // next two lines are head
                        edicontent += "ISA*00*          *00*          *12*" + settings.Get("EDIPhone") + "     *01*809988975      *" + String.Format("{0:yyMMdd}*{0:hhmm}", payment.created) + "*U*00401*" + order.payment_id.ToString("000000000") + "*0*P*>~" + Environment.NewLine;
                        edicontent += "GS*PO*" + settings.Get("EDIPhone") + "*809988975*" + String.Format("{0:yyyyMMdd}*{0:hhmm}", payment.created) + "*" + order.payment_id.ToString("000000000") + "*X*004010~" + Environment.NewLine;
                        // begin PO section
                        edicontent += "ST*850*000000001~" + Environment.NewLine;
                        linecount++;
                        edicontent += "BEG*00*DS*" + ponumber + "**" + String.Format("{0:yyyyMMdd}", payment.created) + "~" + Environment.NewLine;
                        linecount++;
                        edicontent += "CUR*BT*USD~" + Environment.NewLine;
                        linecount++;
                        edicontent += "REF*CO*" + ponumber + "~" + Environment.NewLine;
                        linecount++;
                        edicontent += "REF*IA*" + settings.Get("CURTAccount") + "~" + Environment.NewLine;
                        linecount++;
                        edicontent += "DTM*002*" + String.Format("{0:yyyyMMdd}", payment.created) + "~" + Environment.NewLine;
                        linecount++;
                        edicontent += "N1*ST*" + order.Shipping.first + " " + order.Shipping.last + "~" + Environment.NewLine;
                        linecount++;
                        edicontent += "N3*" + order.Shipping.street1 + ((order.Shipping.street2 != null && order.Shipping.street2 != "") ? "*" + order.Shipping.street2 : "") + "~" + Environment.NewLine;
                        linecount++;
                        edicontent += "N4*" + order.Shipping.city + "*" + order.Shipping.State1.abbr + "*" + order.Shipping.postal_code + "*" + order.Shipping.State1.Country.longAbbr + "~" + Environment.NewLine;
                        if (!String.IsNullOrEmpty(cust.phone)) {
                            linecount++;
                            edicontent += "PER*BD*" + cust.fname + " " + cust.lname + "*TE*" + cust.phone + "~" + Environment.NewLine;
                        }
                        linecount++;
                        edicontent += "PER*BD*" + cust.fname + " " + cust.lname + "*EM*" + cust.email + "~" + Environment.NewLine;
                        linecount++;
                        edicontent += "TD5**2*FDEG*P*" + order.shipping_type + "~" + Environment.NewLine;
                        for (int i = 0; i < order.CartItems.Count; i++) {
                            linecount++;
                            edicontent += "PO1*" + (i + 1).ToString("000") + "*" + order.CartItems[i].quantity + "*EA***BP*" + order.CartItems[i].partID + "*VP*" + order.CartItems[i].partID + "*UP*" + order.CartItems[i].upc + "~" + Environment.NewLine;
                            linecount++;
                            edicontent += "CTP*PUR*" + String.Format("{0:0.00}", order.CartItems[i].price) + "~" + Environment.NewLine;
                            linecount++;
                            edicontent += "PID*F*08***" + order.CartItems[i].shortDesc + "~" + Environment.NewLine;
                        }
                        linecount++;
                        edicontent += "CTT*" + order.CartItems.Count + "*" + order.getCount() + "~" + Environment.NewLine;
                        linecount++;
                        edicontent += "SE*" + linecount + "*000000001~" + Environment.NewLine;
                        // end PO section
                        // begin Tail section
                        edicontent += "GE*1*" + order.payment_id.ToString("000000000") + "~" + Environment.NewLine;
                        edicontent += "IEA*1*" + order.payment_id.ToString("000000000") + "~";

                        // write file
                        DiscountBlobContainer blobcontainer = BlobManagement.GetContainer("edi");
                        BlobContainerPermissions perms = new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob };
                        blobcontainer.Container.SetPermissions(perms);
                        string filename = "PO" + String.Format("{0:yyyyMMdd}_{0:HHmmss}", payment.created) + ".txt";
                        blob = blobcontainer.Container.GetBlockBlobReference("out\\" + filename);
                        byte[] edibytes = Encoding.ASCII.GetBytes(edicontent);
                        MemoryStream edistream = new MemoryStream(edibytes);
                        blob.UploadFromStream(edistream);
                        OrderEDI orderedi = new OrderEDI {
                            orderID = order.ID,
                            editext = edicontent,
                            filename = filename,
                            dateAcknowledged = null,
                        };
                        orderedi.Save();
                    }
                } catch { };
        }
开发者ID:curt-labs,项目名称:CURTeCommerce,代码行数:79,代码来源:EDI.cs

示例6: Insert

 public void Insert(Customer c, Coin coin)
 {
     if (isAvaliable(coin))
     {
         coinStorage.Add(coin);
         totalBill += coin.Rating;
     }
     else
         c.Get(coin);
 }
开发者ID:LoOnyBiker,项目名称:VendingMachineEmulator,代码行数:10,代码来源:VendingMachine.cs

示例7: Purchase

        public virtual void Purchase(Customer c)
        {
            if (status != MachineStatus.Shutdown)
            {
                // customer make selection
                chosen = new Good("Вафли");
                display.Show("Вы выбрали " + chosen.Name);
                expected = prices[chosen];
                while (!CheckTotal())
                {
                    if (cancel)
                        break;

                    display.Show("Внесите " + WaitFor() + " руб");

                    c.CheckoutWallet();
                    Coin coin = c.Find();
                    if (c.isAvaliable(coin))
                    {
                        c.Spend(coin);
                        Insert(c, coin);
                    }

                    if (totalBill > expected)
                        c.Get(new Coin(totalBill-expected));
                }
                c.CheckoutWallet();
                display.Show("Вот " + chosen.Name);
                totalBill = 0;
            }
        }
开发者ID:LoOnyBiker,项目名称:VendingMachineEmulator,代码行数:31,代码来源:VendingMachine.cs

示例8: Suspension

        public dynamic Suspension(int id = 0, bool ajax = false)
        {
            string error = "";
            try{
                Customer cust = new Customer { ID = id };
                cust.Get();
                cust.ToggleSuspended();

            }catch(Exception e){
                error = e.Message;
            }
            if (ajax) {
                return error;
            } else {
                return RedirectToAction("Info", "Customer", new { id = id });
            }
        }
开发者ID:meganmcchesney,项目名称:CURTeCommerce,代码行数:17,代码来源:CustomersController.cs

示例9: Index

        public ActionResult Index()
        {
            // Instantiate our Customer object
            Customer cust = new Customer();

            // Retrieve from Session/Cookie
            cust.GetFromStorage();

            // Get the Customer record
            cust.Get();

            cust.BindAddresses();

            ViewBag.countries = UDF.GetCountries();
            ViewBag.cust = cust;
            ViewBag.error = TempData["error"];
            return View();
        }
开发者ID:meganmcchesney,项目名称:CURTeCommerce,代码行数:18,代码来源:AccountController.cs

示例10: CreatePurchaseOrder

        internal void CreatePurchaseOrder(int id = 0)
        {
            if (!(HttpContext.Current.Request.Url.Host.Contains("127.0.0") || HttpContext.Current.Request.Url.Host.Contains("localhost"))) {
                try {
                    Settings settings = new Settings();
                    Cart order = new Cart().Get(id);
                    if (order.CartItems.Count > 0) {
                        Customer cust = new Customer { ID = order.cust_id };
                        cust.Get();
                        order.BindAddresses();
                        CloudBlob blob = null;
                        string edicontent = "";
                        int linecount = 1;
                        // linecount is just for the PO section and doesn't include the head or tail
                        // next two lines are head
                        edicontent += "ISA*00*          *00*          *12*" + settings.Get("EDIPhone") + "     *01*809988975      *" + String.Format("{0:yyMMdd}*{0:hhmm}", DateTime.Now) + "*U*00401*" + order.payment_id.ToString("000000000") + "*0*P*>~" + Environment.NewLine;
                        edicontent += "GS*PO*" + settings.Get("EDIPhone") + "*809988975*" + String.Format("{0:yyyyMMdd}*{0:hhmm}", DateTime.Now) + "*" + order.payment_id.ToString("000000000") + "*X*004010~" + Environment.NewLine;
                        // begin PO section
                        edicontent += "ST*850*" + order.payment_id + "~" + Environment.NewLine;
                        linecount++;
                        edicontent += "BEG*00*DS*" + order.payment_id + "**" + String.Format("{0:yyyyMMdd}", order.getPayment().created) + "~" + Environment.NewLine;
                        linecount++;
                        edicontent += "CUR*BT*USD~" + Environment.NewLine;
                        linecount++;
                        edicontent += "REF*CO*" + order.payment_id + "~" + Environment.NewLine;
                        linecount++;
                        edicontent += "REF*IA*" + settings.Get("CURTAccount") + "~" + Environment.NewLine;
                        linecount++;
                        edicontent += "DTM*002*" + String.Format("{0:yyyyMMdd}", order.getPayment().created) + "~" + Environment.NewLine;
                        linecount++;
                        edicontent += "N1*ST*" + order.Shipping.first + " " + order.Shipping.last + "~" + Environment.NewLine;
                        linecount++;
                        edicontent += "N3*" + order.Shipping.street1 + ((order.Shipping.street2 != null && order.Shipping.street2 != "") ? "*" + order.Shipping.street2 : "") + "~" + Environment.NewLine;
                        linecount++;
                        edicontent += "N4*" + order.Shipping.city + "*" + order.Shipping.State1.abbr + "*" + order.Shipping.postal_code + "*" + order.Shipping.State1.Country.longAbbr + "~" + Environment.NewLine;
                        if (!String.IsNullOrEmpty(cust.phone)) {
                            linecount++;
                            edicontent += "PER*BD*" + cust.fname + " " + cust.lname + "*TE*" + cust.phone + "~" + Environment.NewLine;
                        }
                        linecount++;
                        edicontent += "PER*BD*" + cust.fname + " " + cust.lname + "*EM*" + cust.email + "~" + Environment.NewLine;
                        linecount++;
                        edicontent += "TD5**2*FDEG*P*" + order.shipping_type + "~" + Environment.NewLine;
                        for (int i = 0; i < order.CartItems.Count; i++) {
                            linecount++;
                            edicontent += "PO1*" + (i + 1).ToString("000") + "*" + order.CartItems[i].quantity + "*EA***BP*" + order.CartItems[i].partID + "*VP*" + order.CartItems[i].partID + "*UP*" + order.CartItems[i].upc + "~" + Environment.NewLine;
                            linecount++;
                            edicontent += "CTP*PUR*" + String.Format("{0:0.00}", order.CartItems[i].price) + "~" + Environment.NewLine;
                            linecount++;
                            edicontent += "PID*F*08***" + order.CartItems[i].shortDesc + "~" + Environment.NewLine;
                        }
                        linecount++;
                        edicontent += "CTT*" + order.CartItems.Count + "*" + order.getCount() + "~" + Environment.NewLine;
                        linecount++;
                        edicontent += "SE*" + linecount + "*" + order.payment_id + "~" + Environment.NewLine;
                        // end PO section
                        // begin Tail section
                        edicontent += "GE*1*" + order.payment_id.ToString("000000000") + "~" + Environment.NewLine;
                        edicontent += "IEA*1*" + order.payment_id.ToString("000000000") + "~";

                        // write file
                        DiscountBlobContainer blobcontainer = BlobManagement.GetContainer("edi");
                        BlobContainerPermissions perms = new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob };
                        blobcontainer.Container.SetPermissions(perms);
                        blob = blobcontainer.Container.GetBlobReference(string.Format("out\\PO{0}_{1}.txt", String.Format("{0:yyyyMMdd}", DateTime.Now), String.Format("{0:HHmmss}", DateTime.Now)));
                        blob.UploadText(edicontent);
                    }
                } catch { };
            }
        }
开发者ID:meganmcchesney,项目名称:CURTeCommerce,代码行数:70,代码来源:EDI.cs


注:本文中的Customer.Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。