本文整理汇总了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;
}
示例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);
}
}
示例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));
}
}
示例4: frmRegistarRevisionInventario
public frmRegistarRevisionInventario(Local local)
{
InitializeComponent();
this.local = local;
btnQuitar.Enabled = false;
CargaPorFecha();
}
示例5: Reserva_AlterarHorario
public Reserva_AlterarHorario()
{
local = MockRepository.GenerateStub<Local>();
data = DateTime.Now.Date;
reserva = new Reserva(local, data, new List<HoraReservaEnum> { HoraReservaEnum.Manha });
}
示例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;
}
示例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;
}
示例8: Empresas
public Empresas(int pIdEmpresa, string pNomeEmpresa, Local pLocalEmpresa, string pEnderecoEmpresa)
{
idEmpresa = pIdEmpresa;
nomeEmpresa = pNomeEmpresa;
enderecoEmpresa = pEnderecoEmpresa;
localEmpresa = pLocalEmpresa;
}
示例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);
}
示例10: Musico
public Musico(int pIdMusico, string pNomeMusico, string pEnderecoMusico, Local pLocalMusico)
{
idMusico = pIdMusico;
nomeMusico = pNomeMusico;
enderecoMusico = pEnderecoMusico;
localMusico = pLocalMusico;
}
示例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);
}
示例12: CopyTo
public Local CopyTo(Local local)
{
local.Type = this.Type;
local.Name = this.Name;
local.PdbAttributes = this.PdbAttributes;
return local;
}
示例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;
}
}
示例14: frmAgregarZonaIni
public frmAgregarZonaIni(Local local)
{
InitializeComponent();
this.local = local;
cargarDatosAnaqueles();
revisarFuncionalidades();
}
示例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);
}