本文整理汇总了C#中System.Boolean.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Boolean.Equals方法的具体用法?C# Boolean.Equals怎么用?C# Boolean.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Boolean
的用法示例。
在下文中一共展示了Boolean.Equals方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Rol
public Rol(int idRol, string nombreRol, List<Privilegio> listaPrivilegios, string descripcionRol, Boolean estado )
{
this.idRol = idRol;
this.nombreRol = nombreRol;
this.listaPrivilegios = listaPrivilegios;
this.descripcionRol = descripcionRol;
if (estado.Equals("Activo"))
this.estadoRol = true;
else if (estado.Equals("Inactivo"))
this.estadoRol = false;
}
示例2: BtnOk_Click
protected void BtnOk_Click(object sender, EventArgs e)
{
busEmployees busemp = new busEmployees();
Employees frmEmp = new Employees();
frmEmp.FullName = this.txtFullname.Text;
frmEmp.Email = this.txtEmail.Text;
frmEmp.Login = this.txtLogin.Text;
frmEmp.LastName = this.txtLastName.Text;
frmEmp.passwords = this.txtPassword.Text;
frmEmp.IDAccess = int.Parse(this.ddpAccess.SelectedValue);
isExisting = isUserExisting();
if (isExisting.Equals(true))
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('User existing')", true);
}
else
{
string x = busemp.insertEmployee(frmEmp);
if (x.Trim() == string.Empty)
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Successfully added new User')", true);
}
else
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Failed to added new User')", true);
}
}
//DataTable dt = new DataTable("User");
//dt = busemp.allUser();
//GridView1.DataSource = dt;
//GridView1.DataBind();
}
示例3: BtnOk_Click
protected void BtnOk_Click(object sender, EventArgs e)
{
busProducts busProd = new busProducts();
FrameWork.Products frmProd = new FrameWork.Products();
frmProd.ProductName = this.txtProdName.Text;
frmProd.ProductCode = this.txtCode.Text;
frmProd.Description = this.txtProdDescription.Text;
frmProd.CategoryID = int.Parse(this.drpCategory.SelectedValue);
frmProd.ProductSizeID = int.Parse(this.drpSize.SelectedValue);
frmProd.UnitOfMeasureID = int.Parse(this.drpUOM.SelectedValue);
isExisting = isUserExisting();
if (isExisting.Equals(true))
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Product already Exists')", true);
}
else
{
string x = busProd.insertProducts(frmProd);
if (x.Trim() == string.Empty)
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Successfully added new Product')", true);
}
else
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Failed to added new Product')", true);
}
}
DataTable dt = new DataTable("User");
dt = busProd.allProducts();
GridView1.DataSource = dt;
GridView1.DataBind();
}
示例4: OrganizeMenuStrip
/// <summary>
/// ennable the menu strip
/// the value was passed from the frmLogin through a boolean
/// </summary>
/// <param name="pBlnEnableMenuStrip"></param>
public void OrganizeMenuStrip(Boolean pBlnEnableMenuStrip)
{
if (pBlnEnableMenuStrip.Equals(true))
MainMenuStrip.Enabled = true;
else
MainMenuStrip.Enabled = false;
}
示例5: executeDataset
// Stored Procedures -> type = true
// Sentencias SQL -> type = false
public static DataSet executeDataset(String ps_command, Boolean pu_type, cls_parameter[] pa_parameters)
{
try
{
IDbCommand vu_cmd = cu_dataProvider.command(ps_command);
foreach (cls_parameter vu_parameter in pa_parameters)
vu_cmd.Parameters.Add(cu_dataProvider.parameter(vu_parameter));
DataSet vu_dts = new DataSet();
IDbDataAdapter vu_adp = cu_dataProvider.adapter();
vu_adp.SelectCommand = vu_cmd;
if (pu_type.Equals(true))
vu_adp.SelectCommand.CommandType = CommandType.StoredProcedure;
if (cu_transaction != null)
{
vu_adp.SelectCommand.Connection = cu_transaction.Connection;
vu_adp.SelectCommand.Transaction = cu_transaction;
vu_adp.Fill(vu_dts);
}
else
{
vu_adp.SelectCommand.Connection = getInstance().getConnection();
vu_adp.Fill(vu_dts);
closeConnection();
}
return vu_dts;
}
catch (Exception ve_exception)
{
throw ve_exception;
}
}
示例6: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
busThick buscat = new busThick();
FrameWork.Thick frmcat = new FrameWork.Thick();
frmcat.Thickness = this.txtCategory.Text;
isExisting = isUserExisting();
if (isExisting.Equals(true))
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Width existing')", true);
}
else
{
buscat.insertCategory(frmcat);
}
DataTable dt = new DataTable("User");
dt = buscat.allCategories();
GridView1.DataSource = dt;
GridView1.DataBind();
}
示例7: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
busSizes bussize = new busSizes();
FrameWork.Sizes frmcat = new FrameWork.Sizes();
frmcat.ProductSize = this.txtSizes.Text;
isExisting = isUserExisting();
if (isExisting.Equals(true))
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Size existing')", true);
}
else
{
bussize.insertSizes(frmcat);
}
DataTable dt = new DataTable("User");
dt = bussize.allSize ();
GridView1.DataSource = dt;
GridView1.DataBind();
}
示例8: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
busUnitOfMeasure busuom = new busUnitOfMeasure();
FrameWork.UnitOfMeasures frmcat = new FrameWork.UnitOfMeasures();
frmcat.UnitOfMeasure = this.txtUOM.Text;
isExisting = isUserExisting();
if (isExisting.Equals(true))
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Unit Of Measure existing')", true);
}
else
{
busuom.insertMeasures(frmcat);
}
DataTable dt = new DataTable("User");
dt = busuom.allUOM();
GridView1.DataSource = dt;
GridView1.DataBind();
}
示例9: GetEmpleados
public IEnumerable<Empleado> GetEmpleados(string criterio, Boolean estado)
{
//var query = from e in Context.Empleados.Include("Cargo")
var query = from e in Context.Empleados.Include(c => c.Cargo)
select e;
if (!String.IsNullOrEmpty(criterio))
{
query = from q in query
where q.Dni.Contains(criterio)
|| (q.ApellidoPaterno +" "+q.ApellidoMaterno +" "+ q.Nombres).Contains(criterio)
select q;
}
if(estado.Equals(true))
{
query = from e in query
where e.Estado.Equals(true)
select e;
}
return query;
}
示例10: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
busEmployees busemp = new busEmployees();
Employees frmEmp = new Employees();
frmEmp.FullName = this.txtFullname.Text;
frmEmp.Email = this.txtEmail.Text;
frmEmp.Login = this.txtLogin.Text;
frmEmp.LastName = this.txtLastName.Text;
frmEmp.passwords = this.txtPassword.Text;
isExisting = isUserExisting();
if (isExisting.Equals(true))
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('User existing')", true);
}
else
{
busemp.insertEmployee(frmEmp);
}
DataTable dt = new DataTable("User");
dt = busemp.allUser();
GridView1.DataSource = dt;
GridView1.DataBind();
}
示例11: FormatColumnForJson
public static String FormatColumnForJson(String colName, String sdt, String alias, Boolean nullable)
{
String result = String.Empty;
alias = String.IsNullOrEmpty(alias) ? String.Format("[{0}]", colName) : String.Format("[{0}].[{1}]", alias, colName);
switch (sdt.ToLower())
{
case "ntext":
case "text":
result = nullable.Equals(true) ?
result = String.Format("ISNULL('\"{0}\":\"'+CONVERT(NVarchar(max),{1})+'\",','\"{0}\":null,')+", colName, alias) :
result = String.Format("ISNULL('\"{0}\":\"'+CONVERT(NVarchar(max),{1})+'\",','')+", colName, alias);
break;
case "uniqueidentifier":
result = nullable.Equals(true) ?
String.Format("ISNULL('\"{0}\":\"'+CONVERT(VarChar(36),{1})+'\",','\"{0}\":null,')+", colName, alias) :
String.Format("ISNULL('\"{0}\":\"'+CONVERT(VarChar(36),{1})+'\",','')+", colName, alias);
break;
case "string":
case "char":
case "nchar":
case "nvarchar":
case "varchar":
result = nullable.Equals(true) ?
String.Format("ISNULL('\"{0}\":\"'+{1}+'\",','\"{0}\":null,')+", colName, alias) :
String.Format("ISNULL('\"{0}\":\"'+{1}+'\",','')+", colName, alias);
break;
case "date":
case "datetime":
case "smalldatetime":
result = nullable.Equals(true) ?
result = String.Format("ISNULL('\"{0}\":\"'+CONVERT(Varchar(25),{1}, 121)+'\",','\"{0}\":null,')+", colName, alias) :
result = String.Format("ISNULL('\"{0}\":\"'+CONVERT(Varchar(25),{1}, 121)+'\",','')+", colName, alias);
break;
case "bigint":
result = String.Format("'\"{0}\":\'+CONVERT(Varchar(30),ISNULL({1},0))+','+", colName, alias);
break;
case "numeric":
case "number":
case "decimal":
case "float":
case "int":
case "money":
case "real":
case "smallmoney":
result = String.Format("'\"{0}\":\'+CONVERT(Varchar(18),ISNULL({1},0))+','+", colName, alias);
break;
case "smallint":
result = String.Format("'\"{0}\":\'+CONVERT(Varchar(7),ISNULL({1},0))+','+", colName, alias);
break;
case "tinyint":
result = String.Format("'\"{0}\":\'+CONVERT(Varchar(5),ISNULL({1},0))+','+", colName, alias);
break;
case "boolean":
case "bool":
case "bit":
result = string.Format("'\"{0}\":\'+CASE WHEN {1} = ISNULL({1},0) THEN 'false' ELSE 'true' END+','+", colName, alias);
break;
default: result = String.Empty;
break;
}
return result;
}
示例12: executeNonQuery
// Stored Procedures -> type = true
// Sentencias SQL -> type = false
public static int executeNonQuery(String ps_command, Boolean pu_type, cls_parameter[] pa_parameters)
{
int vi_result = -1;
try
{
IDbCommand vu_cmd = cu_dataProvider.command(ps_command);
foreach (cls_parameter vu_parameter in pa_parameters)
vu_cmd.Parameters.Add(cu_dataProvider.parameter(vu_parameter));
if (pu_type.Equals(true))
vu_cmd.CommandType = CommandType.StoredProcedure;
if (cu_transaction != null)
{
vu_cmd.Connection = cu_transaction.Connection;
vu_cmd.Transaction = cu_transaction;
vi_result = vu_cmd.ExecuteNonQuery();
}
else
{
vu_cmd.Connection = getInstance().getConnection();
vi_result = vu_cmd.ExecuteNonQuery();
vu_cmd.Dispose();
closeConnection();
}
return vi_result;
}
catch (Exception ve_exception)
{
throw ve_exception;
}
}