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


C# Cliente类代码示例

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


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

示例1: EditarCliente

        public ActionResult EditarCliente(EditarViewModel objViewModel)
        {
            try
            {
                MantenimientoClienteEntities context = new MantenimientoClienteEntities();
                Cliente objCliente = new Cliente(); ;

                if (objViewModel.ClienteId.HasValue)
                    objCliente = context.Cliente.FirstOrDefault(X => X.ClienteId == objViewModel.ClienteId.Value);

                objCliente.Nombre = objViewModel.Nombre;
                objCliente.Apellido = objViewModel.Apellidos;
                objCliente.DNI = objViewModel.DNI;
                objCliente.Edad = objViewModel.Edad;
                objCliente.Sexo = objViewModel.Sexo;
                objCliente.Nivel_Estudio = objViewModel.Nivel;
                objCliente.Telefono = objViewModel.Telefono;
                context.SaveChanges();
                TempData["MensajeRespuesta"] = "Se Edito satisfactoriamente el cliente";
                return RedirectToAction("LstCliente");

            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", "No se pudo editar");
            }
            return View(objViewModel);
        }
开发者ID:carlosZarate20,项目名称:MCliente,代码行数:28,代码来源:HomeController.cs

示例2: GetAll

        public BindingList<GiftCard> GetAll(Cliente clienteOrigen)
        {
            var result = SqlDataAccess.ExecuteDataTableQuery(ConfigurationManager.ConnectionStrings["GrouponConnectionString"].ToString(),
                "GRUPO_N.GetGiftCardCliente", SqlDataAccessArgs
                .CreateWith("@ID_Cliente", clienteOrigen.UserID).Arguments);
            var data = new BindingList<GiftCard>();
            if (result != null && result.Rows != null)
            {
                foreach (DataRow row in result.Rows)
                {
                    data.Add(new GiftCard()
                    {
                        Credito = double.Parse(row["Credito"].ToString()),
                        Fecha = Convert.ToDateTime(row["Fecha"]),
                        ClienteOrigen = new Cliente()
                        {
                            UserName = row["ClienteOrigen"].ToString()
                        },
                        ClienteDestino = new Cliente()
                        {
                            UserName = row["ClienteDestino"].ToString()
                        }
                    });
                }
            }

            return data;
        }
开发者ID:nnimis,项目名称:GrouponDesktop,代码行数:28,代码来源:GiftCardManager.cs

示例3: btnCreaCategoria_Click

        private void btnCreaCategoria_Click(object sender, EventArgs e)
        {
            string res = validar();
            if (res == string.Empty)
            {
                Cliente pro = new Cliente();
                pro.FechaAlta = dtFechaAlta.Value;
                pro.Apellido = tbApellido.Text;
                pro.Domicilio = tbDomicilio.Text;
                pro.Email = tbEmail.Text;
                pro.Nombre = tbNombre.Text;
                pro.Tipo = cbTipo.SelectedIndex;
                Agrega.Cliente(pro);
                Telefono x = new Telefono();
                x.Numero = Convert.ToInt32(tbTelefono.Text);
                pro.Telefonos.Add(x);
                if(Agrega.Cliente(pro)==true)
                {
                    MessageBox.Show("El email no puede ser repetido", "Cuidado", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    MessageBox.Show("Se ingreso correctamente", "OK", MessageBoxButtons.OK);

                }
            }
            else
            {
                MessageBox.Show(res, "Cuidado", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            dgvClienteNuevo.DataSource = Devuelve.Clientes();

        }
开发者ID:smatiassosa,项目名称:parcial2.1,代码行数:33,代码来源:frmClienteNuevo.cs

示例4: CadastrarCliente

 public bool CadastrarCliente(Cliente cliente)
 {
     using (_connectionManager.Open())
     {
         return _clienteDao.SalvarCliente(cliente);
     }
 }
开发者ID:rodrigo1208,项目名称:SharpwareDesktop,代码行数:7,代码来源:ClienteController.cs

示例5: Salvar

 public void Salvar(Cliente usr)
 {
     if (usr.ID_CLIENTE > 0)
         Alterar(usr);
     else
         Inserir(usr);
 }
开发者ID:AgendaFacil,项目名称:shenmen,代码行数:7,代码来源:ClienteAplicacao.cs

示例6: btnSalvar_Click

    protected void btnSalvar_Click(object sender, EventArgs e)
    {
        var Cliente = new Cliente();
        try
        {
            if (txtId.Text != "")
            {
                Cliente.IDCliente = int.Parse(txtId.Text);
                Cliente.Get();
            }

            Cliente.Nome = txtDescricao.Text;
            Cliente.IPServidor = txtIPServidor.Text;
            Cliente.DBName = txtDBName.Text;
            Cliente.DBUser = txtDBUser.Text;
            Cliente.DBPassword = txtDBPassword.Text;
            Cliente.Slug = txtSlug.Text;

            Cliente.Save();
            GetCliente((int)Cliente.IDCliente);

            Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('Registro salvo.')</script>");
        }
        catch (Exception err)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('" + FormatError.FormatMessageForJAlert(err.Message) + "')</script>");
        }
    }
开发者ID:Didox,项目名称:MVC_e_Velocit_app,代码行数:28,代码来源:Cliente.aspx.cs

示例7: EnviarEmail

        public StatusEmail EnviarEmail(Cliente cliente)
        {
            // informacoes do cliente
            _cliente = cliente;

            try
            {
                using (var smtpClient = new SmtpClient())
                {
                    // configuracoes para envio
                    smtpClient.EnableSsl = _credential.UsarSsl;
                    smtpClient.Host = _credential.ServidorSmtp;
                    smtpClient.Port = _credential.ServidorPorta;
                    smtpClient.UseDefaultCredentials = false;
                    smtpClient.Credentials = new System.Net.NetworkCredential(_credential.Sender, _credential.SenderPassword);

                    // body
                    var message = new MailMessage(_credential.Sender, cliente.Email, "ScrumToPractice access key", getMessage());
                    message.IsBodyHtml = true;

                    // envia o email
                    smtpClient.Send(message);
                }
                return StatusEmail.Enviado;
            }
            catch (Exception)
            {
                // nao estoura erro pq desta forma o usuario ira receber de qualquer forma o link na tela
            }

            return StatusEmail.Falha;
        }
开发者ID:jbalessandro,项目名称:scrum,代码行数:32,代码来源:EmailPayment.cs

示例8: ClienteTeste

 public void ClienteTeste()
 {
     Cliente cliente = new Cliente(1);
     cliente.Nome = "Mau";
     Assert.AreEqual(1, cliente.IDCliente);
     Assert.AreEqual("Mau",cliente.Nome);
 }
开发者ID:gustavorborba,项目名称:crescer-2015-2,代码行数:7,代码来源:ClienteTest.cs

示例9: NovoCliente

 public void NovoCliente(Cliente cliente)
 {
     if (getString != null)
     {
         using (SqlConnection con = new SqlConnection(getString.ConnectionString))
         {
             SqlCommand cmd = new SqlCommand("InserirCliente", con);
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@clienteID", cliente.ClienteID);
             cmd.Parameters.AddWithValue("@nome", cliente.Nome);
             cmd.Parameters.AddWithValue("@endereco", cliente.Endereco);
             cmd.Parameters.AddWithValue("@cidade", cliente.Cidade);
             cmd.Parameters.AddWithValue("@estado", cliente.Estado);
             cmd.Parameters.AddWithValue("@telefone", cliente.Telefone);
             cmd.Parameters.AddWithValue("@email", cliente.Email);
             cmd.Parameters.AddWithValue("@sexo", cliente.Sexo);
             try
             {
                 con.Open();
                 cmd.ExecuteNonQuery();
             }
             catch (SqlException ex)
             {
                 throw new Exception("Erro: " + ex.Message);
             }
             finally
             {
                 con.Close();
             }
         }
     }
 }
开发者ID:DailsonGomes,项目名称:Banco-de-Dado1,代码行数:32,代码来源:Cliente.cs

示例10: InserirCliente

        /// <summary>
        /// Insere um novo cliente/fornecedor
        /// </summary>
        /// <param name="Cliente"></param>
        public void InserirCliente(Cliente Cliente)
        {
            Cliente.ID = RetornaNovoID();

            db.Cliente.Add(Cliente);
            db.SaveChanges();
        }
开发者ID:thomasvier,项目名称:-PedidosWebVier,代码行数:11,代码来源:ClienteBll.cs

示例11: BuscarPorCPF

 public List<Cliente> BuscarPorCPF(string cpf)
 {
     MySqlDataReader reader = null;
     List<Cliente> clientes = null;
     string cmdText = "SELECT id, nome, cpf FROM cliente WHERE [email protected]";
     using (MySqlCommand cmd = new MySqlCommand(cmdText, _con))
     {
         cmd.Prepare();
         cmd.Parameters.AddWithValue("@cpf", cpf);
         reader = cmd.ExecuteReader();
         clientes = new List<Cliente>();
         if (reader.HasRows)
         {
             while (reader.Read())
             {
                 Cliente cliente = new Cliente();
                 cliente.SetId(reader.GetInt64("id"))
                 .SetNome(reader.GetString("nome"))
                 .SetCPF(reader.GetString("cpf"));
                 clientes.Add(cliente);
             }
         }
         return clientes;
     }
 }
开发者ID:rodrigo1208,项目名称:SharpwareDesktop,代码行数:25,代码来源:ClienteDao.cs

示例12: Venda

 public Venda(Cliente cliente, Funcionario funcionario)
 {
     _cliente = cliente;
     Funcionario = funcionario;
     _data = DateTime.Now;
     _itensVenda = new List<ItemVenda>();
 }
开发者ID:rodrigo1208,项目名称:SharpwareDesktop,代码行数:7,代码来源:Venda.cs

示例13: Venda

        public Venda(Cliente cliente, int numeroDaNota, DateTime dataDaEmissao,
            DateTime dataDaSaida, string descricao, IEnumerable<ItemDaVenda> itens)
        {
            if (cliente == null)
                throw new ArgumentNullException("cliente");

            if (cliente == null)
                throw new ArgumentNullException("cliente");

            if (string.IsNullOrWhiteSpace(descricao))
                throw new ArgumentOutOfRangeException("descricao");

            this.Cliente = cliente;
            this.NumeroDaNota = numeroDaNota;
            this.DataDaEmissao = dataDaEmissao;
            this.DataDaSaida = dataDaSaida;
            this.Descricao = descricao;

            this.Comissoes = new List<Comissao>();
            this.ContasAReceber = new List<ContaAReceber>();
            this.ItensDaVenda = new List<ItemDaVenda>(itens);

            this.ValorTotal = ItensDaVenda.Sum(i => i.ValorTotal);

            GerarComissoes();
            GerarContasAReceber();
        }
开发者ID:ednosilva,项目名称:demo-arquitetura,代码行数:27,代码来源:Venda.cs

示例14: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     int codClien;
     Loader.Visible = false;
     // controlamos que nadie entre sin hacer login
     if (Session["Usuario"] == null)
     {
         Response.Redirect("Default.aspx");
     }
     // mostramos el nombre de usuario en el menú.
     u = (Usuario)Session["Usuario"];
     menuSuperior.InnerHtml = CntAriGes.GetTabGeneralHtml(u.NomUsu, u.NivelAriges);
     // Tomamos el valor del cliente pasado
     if (Request["CodClien"] == null)
     {
         // que hacer si falla el código pasado
     }
     codClien = int.Parse(Request["CodClien"].ToString());
     cliente = CntAriGes.GetCliente(codClien);
     if (cliente == null)
     {
         lblNomClien.Text = string.Format("Cliente con código {0} desconocido", codClien);
         return;
     }
     lblNomClien.Text = cliente.NomClien;
     CargarTabs(cliente);
     CargarCuerpo(cliente);
 }
开发者ID:rafaelgr,项目名称:ArigesMovil,代码行数:28,代码来源:ClientesPrecios.aspx.cs

示例15: btnAceptar_Click

    //EVENTOS CLICK
    protected void btnAceptar_Click(object sender, EventArgs e)
    {
        try
        {
            Cliente oCliente = new Cliente();
            oCliente = oClienteSession;

            Abogado oAbgado = new Abogado();
            oAbgado.Id = Convert.ToInt32(ddlAbogados.SelectedItem.Value);

            Turno oTurno = new Turno();
            oTurno.Cliente = oCliente;
            oTurno.Abogado = oAbgado;
            oTurno.FechaTurno = DateTime.Now;
            oTurno.Descripcion = txtDescripcion.Text;

            Controller.guardarTurno(oTurno, "Insert");

            lblError.Visible = true;
            lblError.ForeColor = Color.Green;
            lblError.Text = "Se Ha Cargado Correctamente El Turno";
        }
        catch(Exception)
        {
            lblError.Visible = true;
            lblError.ForeColor = Color.Red;
            lblError.Text = "Ocurrio Un Problema Al Cargar El Turno";
        }
    }
开发者ID:dkturco,项目名称:EJ,代码行数:30,代码来源:NuevoTurno.aspx.cs


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