コード例 #1
0
        public void Insert(Implementer implementer)
        {
            string query = "INSERT Into Implementers (FirstName, LastName,  Patronymic) VALUES (@firstName, @lastName, @patronymic)";

            SqlParameter[] sqlParameters = new SqlParameter[3];
            sqlParameters[0] = new SqlParameter("@firstName", implementer.FirstName);
            sqlParameters[1] = new SqlParameter("@lastName", implementer.LastName);
            sqlParameters[2] = new SqlParameter("@patronymic", implementer.Patronymic);
            connection.Update(query, sqlParameters);
        }
コード例 #2
0
        public void Insert(Work work)
        {
            string query = "INSERT Into Works (WorkName, StartDate,  EndDate, Status, ImplementerId) VALUES (@workName, @startDate, @endDate, @status, @implementerId)";

            SqlParameter[] sqlParameters = new SqlParameter[5];
            sqlParameters[0] = new SqlParameter("@workName", work.WorkName);
            sqlParameters[1] = new SqlParameter("@startDate", work.StartDate);
            sqlParameters[2] = new SqlParameter("@endDate", work.EndDate);
            sqlParameters[3] = new SqlParameter("@status", work.Status);
            sqlParameters[4] = new SqlParameter("@implementerId", work.ImplementerId);
            connection.Update(query, sqlParameters);
        }