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


C# Local类代码示例

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


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

示例1: getAll

        public IEnumerable<Local> getAll()
        {
            MySqlCommand cmm = new MySqlCommand();

            StringBuilder sql = new StringBuilder();
            sql.Append("select  * ");
            sql.Append(" FROM locais  ");

            cmm.CommandText = sql.ToString();

            MySqlDataReader dr = conn.executarConsultas(cmm);
            while (dr.Read())
            {

                Local loc = new Local
                {
                    idLocal = (int)dr["idLocal"],
                    sigla = (string)dr["sigla"],
                    nomeEstado = (string)dr["nomeEstado"],
                    nomeCidade = (string)dr["nomeCidade"],

                };
                local.Add(loc);
            }
            dr.Dispose();
            return local;
        }
开发者ID:Feldens00,项目名称:Music-Empire,代码行数:27,代码来源:LocalRepositorys.cs

示例2: VisitAssignmentStatement

 public override Statement VisitAssignmentStatement(AssignmentStatement assignment)
 {
   MemberBinding binding = assignment.Target as MemberBinding;
   if (binding != null) 
   {
     Expression target = VisitExpression(binding.TargetObject);
     Field boundMember = (Field) binding.BoundMember;
     Expression source = VisitExpression(assignment.Source);
     if (!boundMember.IsStatic && !boundMember.DeclaringType.IsValueType && boundMember.DeclaringType.Contract != null && boundMember.DeclaringType.Contract.FramePropertyGetter != null && boundMember != boundMember.DeclaringType.Contract.FrameField) 
     {
       Local targetLocal = new Local(boundMember.DeclaringType);
       Statement evaluateTarget = new AssignmentStatement(targetLocal, target, assignment.SourceContext);
       Local sourceLocal = new Local(boundMember.Type);
       Statement evaluateSource = new AssignmentStatement(sourceLocal, source, assignment.SourceContext);
       Expression guard = new MethodCall(new MemberBinding(targetLocal, boundMember.DeclaringType.Contract.FramePropertyGetter), null, NodeType.Call, SystemTypes.Guard);
       Statement check = new ExpressionStatement(new MethodCall(new MemberBinding(guard, SystemTypes.Guard.GetMethod(Identifier.For("CheckIsWriting"))), null, NodeType.Call, SystemTypes.Void));
       Statement stfld = new AssignmentStatement(new MemberBinding(targetLocal, boundMember), sourceLocal, assignment.SourceContext);
       return new Block(new StatementList(new Statement[] {evaluateTarget, evaluateSource, check, stfld}));
     } 
     else
     {
       binding.TargetObject = target;
       assignment.Source = source;
       return assignment;
     }
   }
   else
   {
     return base.VisitAssignmentStatement(assignment);
   }
 }
开发者ID:tapicer,项目名称:resource-contracts-.net,代码行数:31,代码来源:GuardedFieldAccessInstrumenter.cs

示例3: agregarLocal

        public void agregarLocal(String _nombre, String _telefono, int _preferencia, int _provincia, String _url, String _descripcion = "")
        {
            try
            {
                Local local = new Local(0,_nombre, _url, _telefono, _descripcion, _preferencia, _provincia);

                if (local.IsValid)
                {
                   LocalRepositorio.Instance.Insert(local);
                   LocalRepositorio.Instance.Save();
                }
                else
                {
                    StringBuilder sb = new StringBuilder();
                    foreach (RuleViolation rv in local.GetRuleViolations())
                    {
                        sb.AppendLine(rv.ErrorMessage);
                    }
                    throw new ApplicationException(sb.ToString());
                }

            }
            catch (DataAccessException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("Error: {0}", ex.Message));
            }
        }
开发者ID:La-Orden-del-Casuario,项目名称:Administrador-de-Mapas,代码行数:31,代码来源:GestorLocales.cs

示例4: frmRegistarRevisionInventario

 public frmRegistarRevisionInventario(Local local)
 {
     InitializeComponent();
     this.local = local;
     btnQuitar.Enabled = false;
     CargaPorFecha();
 }
开发者ID:pfizzer,项目名称:papyrusten,代码行数:7,代码来源:frmRegistrarRevisionInventario.cs

示例5: Reserva_AlterarHorario

        public Reserva_AlterarHorario()
        {
            local = MockRepository.GenerateStub<Local>();
            data = DateTime.Now.Date;

            reserva = new Reserva(local, data, new List<HoraReservaEnum> { HoraReservaEnum.Manha });
        }
开发者ID:danielsilva,项目名称:--Integer--,代码行数:7,代码来源:Reserva_AlterarHorario.cs

示例6: IsAnonymousLocal

        /// <summary>
        /// Returns true if the local variable has no name in the IL and the name was introduced by the IL reader.
        /// </summary>
        public static bool IsAnonymousLocal(Local local)
        {
            if (local == null)
                return false;

            return local.Anonymous;
        }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:10,代码来源:NameUtils.cs

示例7: Delete

        public byte Delete(Local instance)
        {
            ISession hisession = null;
            try
            {
                hisession = NHibernateHelper.GetCurrentSession();
                hisession.BeginTransaction();
                hisession.Delete(instance);
                hisession.Transaction.Commit();
                hisession.Close();
                return 1;
            }
            catch (Exception ex)
            {
                if (hisession != null)
                {
                    if (hisession.IsOpen)
                    {
                        hisession.Close();
                    }
                }

            }
            return 0;
        }
开发者ID:pfizzer,项目名称:papyrusten,代码行数:25,代码来源:LocalDA.cs

示例8: Empresas

 public Empresas(int pIdEmpresa, string pNomeEmpresa, Local pLocalEmpresa, string pEnderecoEmpresa)
 {
     idEmpresa = pIdEmpresa;
     nomeEmpresa = pNomeEmpresa;
     enderecoEmpresa = pEnderecoEmpresa;
     localEmpresa = pLocalEmpresa;
 }
开发者ID:Feldens00,项目名称:Music-Empire,代码行数:7,代码来源:Empresas.cs

示例9: PutLocal

        public IHttpActionResult PutLocal(int id, Local local)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != local.Id)
            {
                return BadRequest();
            }

            db.Entry(local).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!LocalExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
开发者ID:marioffdsw,项目名称:AppaLite,代码行数:32,代码来源:LocalesController.cs

示例10: Musico

 public Musico(int pIdMusico, string pNomeMusico, string pEnderecoMusico, Local pLocalMusico)
 {
     idMusico = pIdMusico;
     nomeMusico = pNomeMusico;
     enderecoMusico = pEnderecoMusico;
     localMusico = pLocalMusico;
 }
开发者ID:Feldens00,项目名称:Music-Empire,代码行数:7,代码来源:Musico.cs

示例11: frmIngresarProductos

 public frmIngresarProductos(Local local)
 {
     if (!local.Estado.Equals("Activo"))
     {
         Utils.Utils.Mensaje("El local del cual está realizando la transacción no está activo", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     InitializeComponent();
     this.local = local;
     dgvProductos.AllowUserToAddRows = false;
     dgvProductos.AllowUserToDeleteRows = false;
     txtNroDocumento.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaNumerico);
     this.AcceptButton = btnCargarDatos;
     List<ListItem> listItem = new List<ListItem>();
     ListItem e1 = new ListItem("Compra", (int)TipoMov.Compra);
     ListItem e3 = new ListItem("Consignacion", (int)TipoMov.Consignacion);
     ListItem e4 = new ListItem("Transferencia", (int)TipoMov.Transferencia);
     listItem.Add(e1);
     listItem.Add(e3);
     listItem.Add(e4);
     cboTipoMovimiento.DataSource = listItem;
     cboTipoMovimiento.DisplayMember = "Mostrar";
     cboTipoMovimiento.ValueMember = "Valor";
     lblFecha.Show();
     zonas = (new ZonasBL()).ObtenerDatos(this.local);
 }
开发者ID:pfizzer,项目名称:papyrusten,代码行数:26,代码来源:frmIngresarProductos.cs

示例12: CopyTo

 public Local CopyTo(Local local)
 {
     local.Type = this.Type;
     local.Name = this.Name;
     local.PdbAttributes = this.PdbAttributes;
     return local;
 }
开发者ID:BahNahNah,项目名称:dnSpy,代码行数:7,代码来源:LocalOptions.cs

示例13: GetAll

        public List<Local> GetAll()
        {
            try
            {
                var lista = new List<Local>();

                var sql = "select * from " + this.Tabela;

                var dataSet = new DataSet();
                var query = new MySqlDataAdapter(sql, CorridaDAO.StringConexao);
                query.Fill(dataSet);

                foreach (var item in dataSet.Tables[0].AsEnumerable().ToList())
                {
                    var local = new Local()
                    {
                        Id = Convert.ToInt16(item["Id"]),
                        Cidade = item["Cidade"].ToString(),
                        Uf = item["Uf"].ToString()
                    };

                    lista.Add(local);
                }

                return lista;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return null;
            }
        }
开发者ID:mdamaceno,项目名称:TodoList,代码行数:32,代码来源:LocalEntity.cs

示例14: frmAgregarZonaIni

 public frmAgregarZonaIni(Local local)
 {
     InitializeComponent();
     this.local = local;
     cargarDatosAnaqueles();
     revisarFuncionalidades();
 }
开发者ID:pfizzer,项目名称:papyrusten,代码行数:7,代码来源:frmAgregarZonaIni.cs

示例15: IsSame

        internal bool IsSame(Local other)
        {
            if((object)this == (object)other) return true;

            object ourVal = value; // use prop to ensure obj-disposed etc
            return other != null && ourVal == (object)(other.value); 
        }
开发者ID:CragonGame,项目名称:GameCloud.IM,代码行数:7,代码来源:Local.cs


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