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


C# System.Int32类代码示例

本文整理汇总了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;
                }
            }

        }
开发者ID:vodolijabg,项目名称:LS,代码行数:25,代码来源:Ponuda.cs

示例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;
        }
开发者ID:JasonDevStudio,项目名称:Cnita,代码行数:39,代码来源:LogicCategory.cs

示例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());
        }
开发者ID:subbuballa,项目名称:Walkyr,代码行数:7,代码来源:IGraphExtensions.cs

示例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;
        }
开发者ID:Blahfargl,项目名称:Glubenheim,代码行数:34,代码来源:MainActivity.cs

示例5: IsHooked

 public static bool IsHooked(Int32 processId)
 {
     lock (HookedProcesses)
     {
         return HookedProcesses.Contains(processId);
     }
 }
开发者ID:spazzarama,项目名称:Afterglow,代码行数:7,代码来源:HookManager.cs

示例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;
        }
开发者ID:xfurry,项目名称:eventAI_tool,代码行数:60,代码来源:DbScriptControl.cs

示例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;
        }
开发者ID:bloomj,项目名称:BurritoPOS_CSharp,代码行数:40,代码来源:ManagerSvcSQLImpl.cs

示例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;
        }
开发者ID:Team7-SoftEng,项目名称:GateofGabethulu-launcher,代码行数:27,代码来源:Client.cs

示例9: NpgsqlParse

        public NpgsqlParse(String prepareName, byte[] queryString, Int32[] parameterIDs)
        {
            _bPrepareName = BackendEncoding.UTF8Encoding.GetBytes(prepareName);
            _bQueryString = queryString;

            _parameterIDs = parameterIDs;
        }
开发者ID:timoch,项目名称:Npgsql-fdb,代码行数:7,代码来源:NpgsqlParse.cs

示例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;
     }
 }
开发者ID:voltagex,项目名称:rencode-sharp,代码行数:10,代码来源:BStruct.cs

示例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;
        }
开发者ID:GroupeStageSPPP,项目名称:STAGE,代码行数:33,代码来源:GenreDB.cs

示例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();
                }
            }
        }
开发者ID:vodolijabg,项目名称:LS,代码行数:32,代码来源:Ponuda.cs

示例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"];
 }
开发者ID:MaximilianoFelice,项目名称:gdd-2014,代码行数:7,代码来源:StayHandler.cs

示例14: UpdateFromInput

 public void UpdateFromInput(EditStageViewModel editStageViewModel)
 {
     World = Int32.Parse(editStageViewModel.InputWorld);
     Stage = Int32.Parse(editStageViewModel.InputStage);
     StageName = editStageViewModel.InputStageName;
     StageDescription = editStageViewModel.InputStageDescription;
 }
开发者ID:lltcggie,项目名称:StageMapEditor,代码行数:7,代码来源:StageModel_Partial.cs

示例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"];
 }
开发者ID:MaximilianoFelice,项目名称:gdd-2014,代码行数:7,代码来源:StayHandler.cs


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