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


C# Customers类代码示例

本文整理汇总了C#中Customers的典型用法代码示例。如果您正苦于以下问题:C# Customers类的具体用法?C# Customers怎么用?C# Customers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: loadGridView

    /// <summary>
    /// Method which loads the gridview with all the Customers.
    /// </summary>
    protected void loadGridView()
    {
        Customers customer = new Customers();

        GridView1.DataSource = customer.getAllCustomers();
        GridView1.DataBind();
    }
开发者ID:efigarolam,项目名称:Snackthat,代码行数:10,代码来源:viewallcustomers.aspx.cs

示例2: FindCustomersTestBlankString

        public void FindCustomersTestBlankString()
        {
            Customers target = new Customers
                {new Customer()
                      { CustomerId = 1,
                        FirstName="Rosie",
                        LastName = "Cotton",
                        EmailAddress = "[email protected]"},
                new Customer()
                      { CustomerId = 2,
                        FirstName="Bilbo",
                        LastName = "Baggins",
                        EmailAddress = "[email protected]"},
                new Customer()
                      { CustomerId = 3,
                        FirstName="Frodo",
                        LastName = "Baggins",
                        EmailAddress = "[email protected]"}};

            string customerName = "   ";
            List<Customer> expected = null;
            List<Customer> actual;

            actual = target.FindCustomers(customerName);
            Assert.AreEqual(expected, actual);
        }
开发者ID:fredatgithub,项目名称:VS-AcmeCustomerManagement,代码行数:26,代码来源:CustomersTest.cs

示例3: DeleteCustomer

        public void DeleteCustomer(Customers cus)
        {
            Customers customer = db.Customers.Find(cus.CustomerID);

            db.Customers.Remove(customer);
            db.SaveChanges();
        }
开发者ID:CemreAkyel,项目名称:AjaxStudy,代码行数:7,代码来源:HomeController.cs

示例4: AuthorizeOrder

        public static void AuthorizeOrder(dynamic customer, dynamic order) {
            dynamic itemTable = new OrderItems();
            dynamic productionsTable = new Productions();
            dynamic customersTable = new Customers();
            //loop the items and set auth accordingly
            foreach (var item in itemTable.Find(OrderID:order.ID)) {
                if (item.SKU == "monthly") {
                    //bump the customer's streaming
                    if (customer.StreamUntil < DateTime.Today.AddMonths(-1))
                        customer.StreamUntil = DateTime.Today.AddMonths(-1);
                    customer.StreamUntil = customer.StreamUntil.AddMonths(1);
                    customersTable.Update(customer,customer.ID);
                } else if (item.SKU == "yearly") {
                    if (customer.StreamUntil < DateTime.Today.AddYears(-1))
                        customer.StreamUntil = DateTime.Today.AddYears(-1);

                    if (customer.DownloadUntil < DateTime.Today.AddYears(-1))
                        customer.DownloadUntil = DateTime.Today.AddYears(-1);

                    customer.StreamUntil = customer.StreamUntil.AddYears(1);
                    customer.DownloadUntil = customer.DownloadUntil.AddYears(1);
                    customersTable.Update(customer,customer.ID);
                } else {
                    Authorize(customer, productionsTable.First(Slug: item.SKU));
                }
            }

        }
开发者ID:kodoroph,项目名称:mvc3,代码行数:28,代码来源:DigitalRights.cs

示例5: loadCustomers

    /// <summary>
    /// Loads all the Customers and its Addresses on the gridview
    /// </summary>
    protected void loadCustomers(int idRoute)
    {
        Customers customers = new Customers();
        DataTable dt;
        dt = customers.getCustomersAndAddressesToEdit(idRoute);
        if (dt != null && dt.Rows.Count > 0)
        {
            showCustomers = true;
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
        else
        {
            showCustomers = false;
        }

        DataTable addressesByRoute;
        addressesByRoute = customers.getCustomersAndAddressesByRoute(idRoute);

        for (int i = 0; i < addressesByRoute.Rows.Count; i++)
        {
            this.idAddressesByRoute.Add(addressesByRoute.Rows[i].ItemArray[0].ToString());
        }

        this.setDataToScript(this.idAddressesByRoute);
    }
开发者ID:efigarolam,项目名称:Snackthat,代码行数:29,代码来源:editroute.aspx.cs

示例6: CustomerEdit

 /// <summary>
 /// 此方法用于修改客户信息
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public static bool CustomerEdit(Customers obj)
 {
     List<SqlParameter> list = new List<SqlParameter>
     {
         new SqlParameter("@CusAddress",obj.CusAddress),
         new SqlParameter("@CusZip",obj.CusZip),
         new SqlParameter("@CusFax",obj.CusFax),
         new SqlParameter("@CusWebsite",obj.CusWebsite),
         new SqlParameter("@CusLicenceNo",obj.CusLicenceNo),
         new SqlParameter("@CusChieftain",obj.CusChieftain),
         new SqlParameter("@CusBankroll",obj.CusBankroll),
         new SqlParameter("@CusTurnover",obj.CusTurnover),
         new SqlParameter("@CusBank",obj.CusBank),
         new SqlParameter("@CusBankNo",obj.CusBankNo),
         new SqlParameter("@CusLocalTaxNo",obj.CusLocalTaxNo),
         new SqlParameter("@CusNationalTaxNo",obj.CusNationalTaxNo),
         new SqlParameter("@CusID",obj.CusID)
     };
     string sql = @"update Customers set
                                         [email protected] ,
                                         [email protected] ,
                                         [email protected] ,
                                         [email protected] ,
                                         [email protected] ,
                                         [email protected] ,
                                         [email protected] ,
                                         [email protected] ,
                                         [email protected] ,
                                         [email protected] ,
                                         [email protected]usLocalTaxNo ,
                                         [email protected]
                                         where [email protected] ";
     return DBHelp.ExecuteCUD(sql, list) > 0;
 }
开发者ID:BensterS,项目名称:CRM,代码行数:39,代码来源:CustomersDAL.cs

示例7: PostCustomers

        public IHttpActionResult PostCustomers(Customers customers)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.Customers.Add(customers);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (CustomersExists(customers.CustomerID))
                {
                    return Conflict();
                }
                else
                {
                    throw;
                }
            }

            return CreatedAtRoute("DefaultApi", new { id = customers.CustomerID }, customers);
        }
开发者ID:optimized4u,项目名称:WebAPICRUD,代码行数:27,代码来源:CustomerController.cs

示例8: btnConfirm_Click

    protected void btnConfirm_Click(object sender, EventArgs e)
    {
        if (!chkUser.Checked)
        {
            Response.Write("<script LANGUAGE='JavaScript' >alert('You should accpet our license to register in our website!')</script>");
        }
        else
        {

            if (this.IsValid && this.IsPostBack)
            {
                Customers customer = new Customers();
                customer.Email = txtEmail.Text;
                customer.Name = txtName.Text;
                customer.PassWord = txtPassWord2.Text;
                customer.Address = txtAddress.Text;
                customer.CardNo = txtCardNo.Text;
                customer.CardName = txtCardName.Text;
                customer.PhoneNumber = txtPhoneNumber.Text;
                customer.ExpireDate = txtExpireDate.Text;
                customer.Spent = "0";
                CustomersDB.InsertCustomer(customer);
                Application["AccountEmail"] = txtEmail.Text;
                Session["AccountEmail"] = txtEmail.Text;
                Response.Redirect("AccountPage.aspx");
            }
        }
    }
开发者ID:Chengxuan,项目名称:ClothStore,代码行数:28,代码来源:Register.aspx.cs

示例9: GetCustomersByState

        public List<Customers> GetCustomersByState(string state)
        {
            using (var conn = new SqlConnection(_connectionString))
            {
                conn.Open();
                var cmd = new SqlCommand(@"
                Select * from Customers Where State = @state 
                ",conn);
                
                cmd.Parameters.Add("@state",SqlDbType.NVarChar, 50).Value = state;
                using (var rd = cmd.ExecuteReader())
                {
                    while(rd.Read())
                    {
                        var c = new Customers {
                            CustomerID = (int)rd["CustomerID"],
                            FirstName = (string)rd["FirstName"],
                            LastName = (string)rd["LastName"],
                            Address = (string)rd["Address"]
                        });
                    }
                }

            }
        }
开发者ID:JEAlcala,项目名称:EpicU_Coding,代码行数:25,代码来源:OrderService.cs

示例10: GetCustomers

 public static List<Customers> GetCustomers()
 {
     List<Customers> cumstomerList = new System.Collections.Generic.List<Customers>();
     SqlConnection con = new SqlConnection(GetConnectionString());
     string sel = "SELECT Email,Name,PassWord,Address,CardNo,CardName,Spent,PhoneNumber,ExpireDate " +
         "FROM Customers ORDER BY Email";
     SqlCommand cmd = new SqlCommand(sel, con);
     con.Open();
     SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
     Customers customer;
     while (dr.Read())
     {
         customer = new Customers();
         customer.Email = dr["Email"].ToString();
         customer.Name = dr["Name"].ToString();
         customer.PassWord = dr["PassWord"].ToString();
         customer.Address = dr["Address"].ToString();
         customer.CardNo = dr["CardNo"].ToString();
         customer.CardName = dr["CardName"].ToString();
         customer.Spent = dr["Spent"].ToString();
         customer.PhoneNumber = dr["PhoneNumber"].ToString();
         customer.ExpireDate = dr["ExpireDate"].ToString();
         cumstomerList.Add(customer);
     }
     dr.Close();
     return cumstomerList;
 }
开发者ID:Chengxuan,项目名称:ClothStore,代码行数:27,代码来源:CustomersDB.cs

示例11: ChckCustId

    protected void ChckCustId()
    {
        string cust_id = Request.QueryString["cust_id"];

        if (cust_id != null)
        {
            Customers ChckCust = new Customers();
            bool result = ChckCust.ChckCustById(Convert.ToInt32(cust_id));
            bool CustNb = ChckCust.ChckCustNetBankingById(Convert.ToInt32(cust_id));

            if (result != false)
            {
                if (CustNb != false)
                {
                    Panel2.Visible = true;
                    Panel1.Visible = false;
                    NetBanking NBCustDataById = NetBanking.NBData_ByCustId(Convert.ToInt32(cust_id));

                    if (NBCustDataById.NB_Status == "1")
                    {
                        ButtonAllowNB.Visible = false;
                    }
                }
                else
                {
                    Panel1.Visible = true;
                }
            }
            else
            {
                Panel1.Visible = true;
            }
        }
    }
开发者ID:rkchauhan,项目名称:Net-Banking-in-DotNet-LW,代码行数:34,代码来源:net_banking.aspx.cs

示例12: Save

        public Customers Save(Customers entity)
        {
            if(entity.Id==0)
            {
                var ret =  this.context.Customers.Add(entity);
                this.context.SaveChanges();
                return ret;
            }else
            {
                Customers data = GetById(entity.Id);
                data.CustomerCode = entity.CustomerCode;
                data.CompanyName = entity.CompanyName;
                data.ContactName = entity.ContactName;
                data.ContactTitle = entity.ContactTitle;
                data.Address = entity.Address;
                data.CountryID = entity.CountryID;
                data.CityID = entity.CityID;
                data.RegionID = entity.RegionID;
                data.PostalCode = entity.PostalCode;
                data.Phone = entity.Phone;
                data.Fax = entity.Fax;
                data.UpdateBy = entity.UpdateBy;
                data.UpdateDate = DateTime.Now;

                data.DemoGraphics = entity.DemoGraphics;

                this.context.SaveChanges();
                return data;

            }
        }
开发者ID:anawatj,项目名称:Northwind_net,代码行数:31,代码来源:CustomersRepository.cs

示例13: Page_Load

    /// <summary>
    /// Loads the page and analizes the QueryString to catch de GET vars.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Request.QueryString.Get("id") != null)
            {
                int idRoute = Convert.ToInt16(Request.QueryString.Get("id"));

                Routes route = new Routes();
                DataTable dt;

                dt = route.getRouteByID(idRoute);

                if (dt != null && dt.Columns[0].Caption == "Router_Dont_Exists")
                {
                    Response.Redirect(webURL + "views/routes/viewallroutes.aspx");
                }
                else if (dt.Rows.Count == 1)
                {
                    this.routeid = dt.Rows[0].ItemArray[0].ToString();
                    this.name = dt.Rows[0].ItemArray[1].ToString();

                    DetailsView1.DataSource = dt;
                    DetailsView1.DataBind();

                    if (DetailsView1.Rows[2].Cells[1].Text == "&nbsp;")
                    {
                        DetailsView1.Rows[2].Cells[1].Text = "<a href=\"" + webURL + "views/routes/assignroutes.aspx\">Asignar</a>";
                    }

                    Customers customers = new Customers();

                    dt = customers.getCustomersAndAddressesByRoute(Convert.ToInt16(this.routeid));
                    if (dt != null && dt.Rows.Count > 0 )
                    {
                        showCustomers = true;
                        GridView1.DataSource = dt;
                        GridView1.DataBind();
                    }
                    else
                    {
                        showCustomers = false;
                    }
                }
                else
                {
                    Response.Redirect(webURL + "views/routes/viewallroutes.aspx");
                }

            }
            else
            {
                Response.Redirect(webURL + "views/routes/viewallroutes.aspx");
            }
        }
        catch (Exception ex)
        {
            Response.Redirect(webURL + "views/routes/viewallroutes.aspx");
        }
    }
开发者ID:efigarolam,项目名称:Snackthat,代码行数:65,代码来源:viewroute.aspx.cs

示例14: Main

        static void Main(string[] args)
        {
            // ---------- STRUCTS ----------
            Customers bob = new Customers();

            bob.createCust("Bob", 15.50, 12345);

            bob.showCust();
            Console.WriteLine("Press Enter to terminate...");
            Console.Read();
        }
开发者ID:JohnCDunn,项目名称:Course-Work-TTA,代码行数:11,代码来源:Structs.cs

示例15: Main

        static void Main(string[] args)
        {
            // ---------- STRUCTS ----------
            Customers bob = new Customers();

            bob.createCust("Bob", 15.50, 12345);

            bob.showCust();

            //-See more at: http://www.newthinktank.com/2015/07/learn-c-one-video/#sthash.aY8Gro6z.dpuf

        }
开发者ID:rebeccapizano,项目名称:Coursework,代码行数:12,代码来源:Structs.cs


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