• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Cliente类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: cadastrarCliente

 public Boolean cadastrarCliente(Cliente objCliente)
 {
     objCliente.Codigo = obtemNovoId();
     try
     {
         if (!temDuplicidade(objCliente, "Cadastrar"))
         {
             db = ServidorSingleton.obterServidor().OpenClient();
             db.Store(objCliente);
             db.Commit();
             return true;
         }
         else {
             return false;
         }
     }
     catch(Exception e)
     {
         throw new Exception("Erro cadastrando o cliente :" + e.Message);
     }
     finally {
         db.Close();
         db.Dispose();
     }
 }
开发者ID:fbsharp,项目名称:Projetos,代码行数:25,代码来源:ClienteDAO.cs


示例17: Crear

        public virtual ActionResult Crear()
        {
            try
            {

                Session["ClienteData"] = null;
                var entidad = new Cliente
                {
                    CLI_RazonSocial = string.Empty,
                    IDDistrito=0,
                    IDDepartamento=0,
                    IDProvincia=0,
                    CLI_RUC= string.Empty,
                    CLI_Correo= string.Empty,
                    CLI_Fax= string.Empty,
                    CLI_IndicadorArea= string.Empty,
                    CLI_Observaciones= string.Empty,
                     IDCliente= 0,
                     CLI_Telefono1= string.Empty,
                     CLI_Telefono2= string.Empty

                };
                PrepararDatos(ref entidad, "Crear");
                return PartialView("Edit", entidad);
            }
            catch (Exception ex)
            {
                logger.Error(string.Format("Mensaje: {0} Trace: {1}", ex.Message, ex.StackTrace));
                return new HttpNotFoundWithViewResult("Error");
            }
        }
开发者ID:JolevqSAC,项目名称:Interv2,代码行数:31,代码来源:ClienteController.cs


示例18: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBoxcalle.Text == "" || textBoxdir.Text == "" || textBoxloc.Text == ""
                || textBoxmail.Text == "" || textBoxnac.Text == "" || textBoxnomb.Text == ""
                || textBoxnro.Text == "" || textBoxpa.Text == "" || textBoxtel.Text == ""
                || textBoxtipo.Text == "" || textBoxap.Text == "" || textBoxdep.Text == "" || textBoxpis.Text == "")
            {
                MessageBox.Show("No dejar campos vacios", "Alerta", MessageBoxButtons.OK);
            }
            else
            {
                Decimal bandera = RepositorioCliente.Instance.ExisteCli(Decimal.Parse(textBoxnro.Text));
                if (bandera == 2)
                {
                    Cliente cli = new Cliente(textBoxnomb.Text, textBoxap.Text, textBoxtipo.Text, Decimal.Parse(textBoxnro.Text),
                        textBoxmail.Text, Decimal.Parse(textBoxtel.Text), textBoxcalle.Text, Decimal.Parse(textBoxdir.Text),
                        Decimal.Parse(textBoxpis.Text), textBoxdep.Text, (dateTimePicker1.Value),
                        textBoxloc.Text, textBoxpa.Text, textBoxnac.Text);

                    RepositorioCliente.Instance.InsertarCliente(cli);
                    char a = cli.apellido[0];
                    char n = cli.nombre[0];
                    MessageBox.Show("Se ha creado correctante. Su usuario es: " + textBoxnro.Text + a.ToString() + n.ToString(), "Mensaje", MessageBoxButtons.OK);

                    cliente = RepositorioCliente.Instance.UltimoIdConUsuarioYPasswordCreado();
                    
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Ya existe un cliente con ese documento", "Alerta", MessageBoxButtons.OK);
                }
            }
        }
开发者ID:cthaeh,项目名称:NINIRODIE-HOTEL,代码行数:35,代码来源:AltaCli.cs


示例19: Cliente

 public static Cliente Cliente(int id)
 {
     ManejaCliente manejaCliente = new ManejaCliente();
     Cliente res = new Cliente();
     res = (Cliente)manejaCliente.buscaPorId(id);
     return res;
 }
开发者ID:smatiassosa,项目名称:parcial2.1,代码行数:7,代码来源:Devuelve.cs


示例20: UserLogin

        private bool UserLogin(string userName, string password)
        {
            Usuario usr = new Usuario();
            usr.Where.Usuario.Value = userName;
            usr.Where.Usuario.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
            usr.Where.Senha.Value = password;
            usr.Where.Senha.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
            usr.Query.Load();
            if (usr.RowCount == 1)
            {
                //LoginUser.UserName = usr.Nome;

                //Roles.CreateRole("Admin");
                //Roles.CreateRole("Usuarios");

                //if (usr.Admin)
                //{
                //    Roles.AddUserToRole(usr.Usuario, "Admin");
                //}
                //else {
                //    Roles.AddUserToRole(usr.Usuario, "Usuarios");
                //}

                Session["Usuario"] = usr;
                Cliente cliente = new Cliente();
                cliente.LoadByPrimaryKey(usr.IdCliente);
                Session["Empresa"] = cliente;
                return true;
            }
            else {
                return false;
            }
        }
开发者ID:rodrigocsouza,项目名称:Swap,代码行数:33,代码来源:Login.aspx.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ClipType类代码示例发布时间:2022-05-24
下一篇:
C# ClientVersionBuild类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap