本文整理汇总了C#中System.Int32类的典型用法代码示例。如果您正苦于以下问题:C# Int32类的具体用法?C# Int32怎么用?C# Int32使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Int32类属于System命名空间,在下文中一共展示了Int32类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DajPonudu
public void DajPonudu(DataTable ponuda, Int32 ponuda_ID)
{
SqlConnection _konekcijaSqlConnection = new SqlConnection();
using (_konekcijaSqlConnection = Konekcija.DajKonekciju())
{
SqlDataAdapter _dajPonuduSQLDataAdapter = new SqlDataAdapter();
SqlCommand _dajPoslednjuPonuduSqlCommand = new SqlCommand("SELECT * FROM vwPonudaZaglavlje where Ponuda_ID = " + ponuda_ID, _konekcijaSqlConnection);
_dajPonuduSQLDataAdapter.SelectCommand = _dajPoslednjuPonuduSqlCommand;
//isprazni tabelu
ponuda.Clear();
try
{
//napuni tabelu
_dajPonuduSQLDataAdapter.Fill(ponuda);
}
catch (Exception)
{
throw;
}
}
}
示例2: CategoryDelete
/// <summary>
/// ���� ɾ��
/// </summary>
/// <param name="id">Id ���</param>
/// <returns>ִ�н��</returns>
public int CategoryDelete(out string resultMsg, Int32 id, DbTransaction tran = null)
{
resultMsg = string.Empty;
int res = 0;
try
{
//�洢��������
string sql = "usp_category_delete_by_id";
//�������
IList<DBParameter> parm = new List<DBParameter>();
parm.Add(new DBParameter() { ParameterName = "ID", ParameterValue = id, ParameterInOut = BaseDict.ParmIn, ParameterType = DbType.Int32 });
//parm.Add(new DBParameter() { ParameterName = "resultMsg", ParameterInOut = BaseDict.ParmOut, ParameterType = DbType.String });
//����ִ��
res = DBHelper.ExecuteNonQuery(sql, true, parm, tran);
//foreach (var item in parm)
//{
// //��ȡ�������ֵ
// if (item.ParameterName == "resultMsg")
// {
// resultMsg = item.ParameterValue.ToString();
// break;
// }
//}
}
catch (Exception ex)
{
if (tran != null)
tran.Rollback();
resultMsg = string.Format("{0} {1}", BaseDict.ErrorPrefix, ex.ToString());
}
return res;
}
示例3: AddNode
public static INode AddNode(this IGraph myIGraph, Int32 myInt32Id)
{
if (myIGraph == null)
throw new ArgumentNullException("myIGraph must not be null!");
return myIGraph.AddNode(myInt32Id.ToString());
}
示例4: OnTouch
// Check touch position on button
public bool OnTouch(View v, MotionEvent e)
{
switch (e.Action)
{
// Get the x and y position for a touch (always before move)
case MotionEventActions.Down:
old_x = e.GetX ();
old_y = e.GetY ();
Console.WriteLine ("x = " + old_x + " y = " + old_y);
break;
// Get the x and y position difference continously
case MotionEventActions.Move:
// Get the difference between current position and old position
new_x = e.GetX () - old_x;
new_y = e.GetY () - old_y;
// Convert to int, to remove decimal numbers (apparently can't be send through the tcp listener)
int_x = Convert.ToInt32 (new_x);
int_y = Convert.ToInt32 (new_y);
// Convert to string, so it can be send
send_x = Convert.ToString (int_x);
send_y = Convert.ToString (int_y);
// Send x and y position over two messages
Connect (ipAddress, send_x);
Connect (ipAddress, send_y);
// Set old position to current position
old_x = e.GetX ();
old_y = e.GetY ();
break;
}
return true;
}
示例5: IsHooked
public static bool IsHooked(Int32 processId)
{
lock (HookedProcesses)
{
return HookedProcesses.Contains(processId);
}
}
示例6: DbScriptControl
public DbScriptControl(Event_dataset_script Data, Int32 ID, uint id)
{
InitializeComponent();
this.Name = ID.ToString();
eventid = ID;
script_id = id;
this.eventCheckbox.Text = "Event: " + ID.ToString();
this.eventCheckbox.Checked = true;
for (int n = 0; n < Info.ScriptCommands.GetLength(0); n++)
this.comboBoxAction.Items.Add(Info.ScriptCommands[n, 0]);
// set width
comboBoxAction.DropDownWidth = DropDownWidth(comboBoxAction);
comboBoxAction.DropDownStyle = ComboBoxStyle.DropDownList;
this.comboBoxAction.SelectedIndex = Data.command;
this.textBoxDelay.Text = Data.delay.ToString();
this.textBox_datalong.Text = Data.datalong.ToString();
this.textBox_datalong2.Text = Data.datalong2.ToString();
this.textBox_buddy.Text = Data.buddy.ToString();
this.textBox_radius.Text = Data.radius.ToString();
this.textBox_flags.Text = Data.dataflags.ToString();
this.textBox_dataint1.Text = Data.dataint.ToString();
this.textBox_dataint2.Text = Data.dataint2.ToString();
this.textBox_dataint3.Text = Data.dataint3.ToString();
this.textBox_dataint4.Text = Data.dataint4.ToString();
this.textBox_posX.Text = Data.position_x.ToString();
this.textBox_posY.Text = Data.position_y.ToString();
this.textBox_posZ.Text = Data.position_z.ToString();
this.textBox_orientation.Text = Data.orientation.ToString();
this.commentTextbox.Text = Data.comment;
//switch (comboBoxAction.SelectedIndex)
//{
// case 0: // talk
// textBox_dataint1.ReadOnly = false;
// textBox_dataint2.ReadOnly = false;
// textBox_dataint3.ReadOnly = false;
// textBox_dataint4.ReadOnly = false;
// break;
// case 3: // move
// case 6: // teleport
// case 10: // summon
// textBox_posX.ReadOnly = false;
// textBox_posY.ReadOnly = false;
// textBox_posZ.ReadOnly = false;
// textBox_orientation.ReadOnly = false;
// break;
//}
locked = false;
}
示例7: deleteManager
/// <summary>
/// This method deletes a manager.
/// </summary>
/// <param name="id">Unique ID of the manager to delete</param>
/// <returns>Success/Failure</returns>
public Boolean deleteManager(Int32 id)
{
dLog.Info("Entering method deleteManager | ID:" + id);
Boolean result = false;
SqlConnection conn = null;
SqlCommand stmt = null;
try
{
String sqlStr = "DELETE FROM Employee WHERE id = @id";
conn = new SqlConnection(connString);
conn.Open();
stmt = new SqlCommand(sqlStr, conn);
stmt.Parameters.Add(new SqlParameter("@id", id));
if (stmt.ExecuteNonQuery() > 0)
result = true;
}
catch (SqlException e1)
{
dLog.Error("SqlException in deleteManager: " + e1.Message);
}
catch (Exception e2)
{
dLog.Error("Exception in deleteManager: " + e2.Message);
}
finally
{
if (conn.State == System.Data.ConnectionState.Open)
conn.Close();
}
return result;
}
示例8: Client
public Client(String host, Int32 port)
{
try
{
clientName = Dns.GetHostName();
}
catch (SocketException se)
{
MessageBox.Show("ERROR: Could not retrieve client's DNS hostname. Please try again." + se.Message + ".", "Client Socket Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
serverName = host;
gamePort = port;
client = new TcpClient(host, port);
netStream = client.GetStream();
reader = new StreamReader(netStream);
writer = new StreamWriter(netStream);
ssl = new SslStream(netStream, false, new RemoteCertificateValidationCallback(ValidateCert));
cert = new X509Certificate2("server.crt");
ssl.AuthenticateAsClient(serverName);
writer.AutoFlush = true;
}
示例9: NpgsqlParse
public NpgsqlParse(String prepareName, byte[] queryString, Int32[] parameterIDs)
{
_bPrepareName = BackendEncoding.UTF8Encoding.GetBytes(prepareName);
_bQueryString = queryString;
_parameterIDs = parameterIDs;
}
示例10: GetBytes
/// <summary>
/// Gets the bytes of an Int32.
/// </summary>
public static unsafe void GetBytes(Int32 value, byte[] buffer, int startIndex)
{
fixed(byte* numRef = buffer)
{
*((int*)(numRef+startIndex)) = value;
}
}
示例11: Get
/// <summary>
/// Récupère une Genre à partir d'un identifiant de client
/// </summary>
/// <param name="Identifiant">Identifant de Genre</param>
/// <returns>Un Genre </returns>
public static Genre Get(Int32 identifiant)
{
//Connection
ConnectionStringSettings connectionStringSettings = ConfigurationManager.ConnectionStrings["EntretienSPPPConnectionString"];
SqlConnection connection = new SqlConnection(connectionStringSettings.ToString());
//Commande
String requete = @"SELECT Identifiant, Libelle FROM Genre
WHERE Identifiant = @Identifiant ;";
SqlCommand commande = new SqlCommand(requete, connection);
//Paramètres
commande.Parameters.AddWithValue("Identifiant", identifiant);
//Execution
connection.Open();
SqlDataReader dataReader = commande.ExecuteReader();
dataReader.Read();
//1 - Création du Genre
Genre genre = new Genre();
genre.Identifiant = dataReader.GetInt32(0);
genre.libelle = dataReader.GetString(1);
dataReader.Close();
connection.Close();
return genre;
}
示例12: ObrisiPonudu
public void ObrisiPonudu(Int32 ponuda_ID)
{
SqlConnection _konekcijaSqlConnection = new SqlConnection();
using (_konekcijaSqlConnection = Konekcija.DajKonekciju())
{
SqlCommand _obrisiRobuSQLCommand = new SqlCommand("uspObrisiPonudu", _konekcijaSqlConnection);
_obrisiRobuSQLCommand.CommandType = CommandType.StoredProcedure;
#region Definisi parametre
_obrisiRobuSQLCommand.Parameters.Add("@Ponuda_ID", SqlDbType.Int).Value = ponuda_ID;
#endregion
try
{
_konekcijaSqlConnection.Open();
_obrisiRobuSQLCommand.ExecuteNonQuery();
}
catch (Exception)
{
throw;
}
finally
{
_konekcijaSqlConnection.Close();
}
}
}
示例13: getStayPrice
public float getStayPrice(Int32 id_booking) {
SqlResults results = new SqlStoredProcedure("[BOBBY_TABLES].SP_GET_STAY_PRICE")
.WithParam("@IdBooking").As(SqlDbType.Int).Value(id_booking)
.WithParam("@Price").As(SqlDbType.Float).AsOutput()
.Execute();
return (float)results["@Price"];
}
示例14: UpdateFromInput
public void UpdateFromInput(EditStageViewModel editStageViewModel)
{
World = Int32.Parse(editStageViewModel.InputWorld);
Stage = Int32.Parse(editStageViewModel.InputStage);
StageName = editStageViewModel.InputStageName;
StageDescription = editStageViewModel.InputStageDescription;
}
示例15: getExtraNights
public Int32 getExtraNights(Int32 id_booking) {
SqlResults results = new SqlStoredProcedure("[BOBBY_TABLES].SP_GET_EXTRA_NIGHTS")
.WithParam("IdBooking").As(SqlDbType.Int).Value(id_booking)
.WithParam("@Extra").As(SqlDbType.Int).AsOutput()
.Execute();
return (Int32)results["@Extra"];
}